first commit
This commit is contained in:
commit
984278dcd1
14 changed files with 3137 additions and 0 deletions
29
src/main.rs
Normal file
29
src/main.rs
Normal file
|
@ -0,0 +1,29 @@
|
|||
use gtk::prelude::*;
|
||||
use gtk::{glib, Application, ApplicationWindow};
|
||||
|
||||
const APP_ID: &str = "org.gtk_rs.HelloWorld2";
|
||||
|
||||
fn main() -> glib::ExitCode {
|
||||
// Create a new application
|
||||
let app = Application::builder().application_id(APP_ID).build();
|
||||
|
||||
// Connect to "activate" signal of `app`
|
||||
app.connect_activate(build_ui);
|
||||
|
||||
// Run the application
|
||||
app.run()
|
||||
}
|
||||
|
||||
fn build_ui(app: &Application) {
|
||||
// Create a window and set the title
|
||||
|
||||
let button = Button::builder
|
||||
|
||||
let window = ApplicationWindow::builder()
|
||||
.application(app)
|
||||
.title("My GTK App")
|
||||
.build();
|
||||
|
||||
// Present window
|
||||
window.present();
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue