use gtk::prelude::*;

use gtk::{Label, Window, WindowType};

fn main() {

// Initialize GTK application

gtk::init().expect("Failed to initialize GTK.");

// Create a new window

let window = Window::new(WindowType::Toplevel);

window.set_title("Display Phrase");

window.set_default_size(200, 100);

// Create a label widget

let label = Label::new(Some("code is a language"));

// Add the label to the window

window.add(&label);

// Connect the 'destroy' event to quit the application

window.connect_delete_event(|_, _| {

gtk::main_quit();

Inhibit(false)

});

// Show all widgets

window.show_all();

// Start the GTK main event loop

gtk::main();

}

Reply to this note

Please Login to reply.

Discussion

No replies yet.