diff options
author | Alexey Yerin <yyp@disroot.org> | 2025-07-02 22:35:03 +0300 |
---|---|---|
committer | Alexey Yerin <yyp@disroot.org> | 2025-07-02 22:35:03 +0300 |
commit | eac027162b330698a74eea2db16f7b82468d421b (patch) | |
tree | 04c99b8265fc196087ab033afd9aa02160977caa | |
parent | d00e93a74db4cf63f662d5d8f0a7ae0b6eb79060 (diff) |
cmd/demo: Remove unnecessary casts
-rw-r--r-- | cmd/demo-gtk3/main.ha | 10 | ||||
-rw-r--r-- | cmd/demo-gtk4/main.ha | 18 |
2 files changed, 14 insertions, 14 deletions
diff --git a/cmd/demo-gtk3/main.ha b/cmd/demo-gtk3/main.ha index a106b5c..7637fcb 100644 --- a/cmd/demo-gtk3/main.ha +++ b/cmd/demo-gtk3/main.ha @@ -7,7 +7,7 @@ use rt; use types::c; fn about_clicked(btn: *gtk::Button, data: *opaque) void = { - let dialog = gtk::about_dialog_new(): *gtk::AboutDialog; + let dialog = gtk::about_dialog_new(); const authors: []*c::char = [ c::nulstr("Harriet?\0"), null: *c::char, @@ -30,15 +30,15 @@ fn about_clicked(btn: *gtk::Button, data: *opaque) void = { 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; + let button = gtk::button_new_with_label(c::nulstr("About\0")); gtk::button_connect_clicked(button, &about_clicked, null); - let headerbar = gtk::header_bar_new(): *gtk::HeaderBar; + let headerbar = gtk::header_bar_new(); 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; + let window = gtk::application_window_new(app); gtk::window_set_titlebar(window, headerbar); gtk::widget_show_all(window); }; @@ -47,7 +47,7 @@ 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, diff --git a/cmd/demo-gtk4/main.ha b/cmd/demo-gtk4/main.ha index 39ca4ca..a3f7ecf 100644 --- a/cmd/demo-gtk4/main.ha +++ b/cmd/demo-gtk4/main.ha @@ -13,15 +13,15 @@ fn about_clicked(btn: *gtk4::Button, data: *opaque) void = { null: *c::char, ]; gtk4::about_dialog_set_license_type( - dialog: *gtk4::AboutDialog, + dialog, gtk4::License::MPL_2_0, ); gtk4::about_dialog_set_authors( - dialog: *gtk4::AboutDialog, + dialog, authors: *[*]*c::char: **c::char, ); gtk4::about_dialog_set_website( - dialog: *gtk4::AboutDialog, + dialog, c::nulstr("https://git.sr.ht/~yerinalexey/hare-gi\0"), ); @@ -32,16 +32,16 @@ fn activate(app: *gio::Application, data: *opaque) void = { const app = app: *gtk4::Application; let button = gtk4::button_new_with_label(c::nulstr("About\0")); - gtk4::button_connect_clicked(button: *gtk4::Button, &about_clicked, null); + gtk4::button_connect_clicked(button, &about_clicked, null); let headerbar = gtk4::header_bar_new(); let title = gtk4::label_new(c::nulstr("hare-gi demo\0")); - gtk4::header_bar_set_title_widget(headerbar: *gtk4::HeaderBar, title); - gtk4::header_bar_set_show_title_buttons(headerbar: *gtk4::HeaderBar, glib::TRUE); - gtk4::header_bar_pack_end(headerbar: *gtk4::HeaderBar, button); + gtk4::header_bar_set_title_widget(headerbar, title); + gtk4::header_bar_set_show_title_buttons(headerbar, glib::TRUE); + gtk4::header_bar_pack_end(headerbar, button); let window = gtk4::application_window_new(app); - gtk4::window_set_titlebar(window: *gtk4::Window, headerbar); + gtk4::window_set_titlebar(window, headerbar); gtk4::widget_show(window); }; @@ -49,7 +49,7 @@ export fn main() void = { let app = gtk4::application_new( c::nulstr("hare_gi.example\0"), gio::ApplicationFlags::FLAGS_NONE, - ): *gio::Application; + ); gio::application_connect_activate(app, &activate, null); const status = gio::application_run( app, rt::argc: int, rt::argv: **c::char, |