6 releases

0.3.5 Jan 11, 2023
0.3.0 Jan 9, 2023
0.2.5 Jan 9, 2023
0.1.7 Jan 5, 2023

#821 in GUI

27 downloads per month

MIT license

40KB
735 lines

RSGT : Rust simple GUI Toolkit

rust-clippy analyze Crates.io Crates.io

RSGT is a simple GUI Library

Design

RSGT's event handling is based on Swing (Java) event handling. (which uses callbacks). In addition, drawing of GUI components uses the GPU (wgpu), allowing for flexible representation.

Example

use rsgt::Size;
use rsgt::event::WindowListener;
use rsgt::rframe::{CloseOperation, RFrameBuilder};

fn main() {
    // Apply Visual Style (Windows only)
    rsgt::os::enable_visual_style();
    // Initialize RFrame
    let mut frame = RFrameBuilder::new()
        .with_size(Size(1280,720))
        .with_title("Show window")
        .with_visible(true)
        .build()
        .unwrap();
    // Add window listener(Callback to detect Window events)
    frame.add_window_listener(SampleWindowListener {});
    // Show window
    frame.run();
}

struct SampleWindowListener {}

impl WindowListener for SampleWindowListener {
}

Execution Result

Show Window

Goal

  • To be able to handle a wide range of applications from simple to complex
  • Ensure that the same code works the same in any environment

License

"RSGT" is under MIT LICENSE

Dependencies

~17–34MB
~344K SLoC