starling-lm-7b-alpha· UC Berkeley
Arena Human Preference 55K
write a program in Rust that shows "Hello world" text in a GTK4 window
- User
write a program in Rust that shows "Hello world" text in a GTK4 window
- Assistant
Here's a simple Rust program that uses the GTK4 crate to display "Hello world" in a GTK4 window:
extern crate gtk; extern crate gtk_application; use gtk::prelude::*; use gtk_application::prelude::*; fn main() { let application = gtk_application::Application::new( Some("org.gtk-rs.hello-world"), Default::default(), ); application.connect_activate(|app| { let window = gtk::ApplicationWindow::new(app); window.set_title("Hello world"); window.set_default_size(300, 100); let label = gtk::Label::new(Some("Hello world")); window.add(&label); window.show_all(); }); application.connect_startup(move |_app| { gtk::init().expect("GTK init failed"); }); application.connect_shutdown(move || std::process::exit(0)); application.run(&[]); }
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.