about summary refs log tree commit diff
path: root/cmd/demo/main.ha
diff options
context:
space:
mode:
authorDrew DeVault <drew@ddevault.org>2025-03-21 10:40:01 +0100
committerAlexey Yerin <yyp@disroot.org>2025-03-21 14:18:01 +0300
commit1e85675b652b4e133a98841d75bb7fe7e00058d5 (patch)
tree54585b454add3aaa3ffe96d6f3e109b46c4563a8 /cmd/demo/main.ha
parent98fc3cf2108790200aa12635bc46e3cb3cb0139a (diff)
Add consistent "3" suffix to gtk3 bits
Signed-off-by: Drew DeVault <drew@ddevault.org>
Diffstat (limited to 'cmd/demo/main.ha')
-rw-r--r--cmd/demo/main.ha57
1 files changed, 0 insertions, 57 deletions
diff --git a/cmd/demo/main.ha b/cmd/demo/main.ha
deleted file mode 100644
index a106b5c..0000000
--- a/cmd/demo/main.ha
+++ /dev/null
@@ -1,57 +0,0 @@
-use gi::gio;
-use gi::glib;
-use gi::gobject;
-use gi::gtk;
-use os;
-use rt;
-use types::c;
-
-fn about_clicked(btn: *gtk::Button, data: *opaque) void = {
-	let dialog = gtk::about_dialog_new(): *gtk::AboutDialog;
-	const authors: []*c::char = [
-		c::nulstr("Harriet?\0"),
-		null: *c::char,
-	];
-	gtk::about_dialog_set_license_type(
-		dialog,
-		gtk::License::MPL_2_0,
-	);
-	gtk::about_dialog_set_authors(
-		dialog,
-		authors: *[*]*c::char: **c::char,
-	);
-	gtk::about_dialog_set_website(
-		dialog,
-		c::nulstr("https://git.sr.ht/~yerinalexey/hare-gi\0"),
-	);
-	gtk::widget_show_all(dialog);
-};
-
-fn activate(app: *gio::Application, data: *opaque) void = {
-	const app = app: *gtk::Application;
-
-	let button = gtk::button_new_with_label(c::nulstr("About\0")): *gtk::Button;
-	gtk::button_connect_clicked(button, &about_clicked, null);
-
-	let headerbar = gtk::header_bar_new(): *gtk::HeaderBar;
-	gtk::header_bar_set_title(headerbar, c::nulstr("hare-gi demo\0"));
-	gtk::header_bar_set_show_close_button(headerbar, glib::TRUE);
-	gtk::header_bar_pack_end(headerbar, button);
-
-	let window = gtk::application_window_new(app): *gtk::ApplicationWindow;
-	gtk::window_set_titlebar(window, headerbar);
-	gtk::widget_show_all(window);
-};
-
-export fn main() void = {
-	let app = gtk::application_new(
-		c::nulstr("hare_gi.example\0"),
-		gio::ApplicationFlags::FLAGS_NONE,
-	): *gtk::Application;
-	gio::application_connect_activate(app, &activate, null);
-	const status = gio::application_run(
-		app, rt::argc: int, rt::argv: **c::char,
-	);
-	gobject::object_unref(app);
-	os::exit(status);
-};