]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - contrib/prtview/LoadPortalFileDialog.cpp
GTK: wrap gtk_widget_set_size_request
[xonotic/netradiant.git] / contrib / prtview / LoadPortalFileDialog.cpp
index 3252bc40bd16bb9e04dbb2e83f3e346af8eef251..890658e14733d2929a1d9c627da74ddfe0aad447 100644 (file)
 #include "prtview.h"
 #include "portals.h"
 
-static void dialog_button_callback( GtkWidget *widget, gpointer data ){
-       GtkWidget *parent;
+static void dialog_button_callback( ui::Widget widget, gpointer data ){
        int *loop, *ret;
 
-       parent = gtk_widget_get_toplevel( widget );
+       auto parent = widget.window();
        loop = (int*)g_object_get_data( G_OBJECT( parent ), "loop" );
        ret = (int*)g_object_get_data( G_OBJECT( parent ), "ret" );
 
@@ -80,7 +79,7 @@ int DoLoadPortalFileDialog(){
        int loop = 1, ret = IDCANCEL;
 
        auto dlg = ui::Window( ui::window_type::TOP );
-       gtk_window_set_title( GTK_WINDOW( dlg ), "Load .prt" );
+       gtk_window_set_title( dlg, "Load .prt" );
        dlg.connect( "delete_event",
                                                G_CALLBACK( dialog_delete_callback ), NULL );
        dlg.connect( "destroy",
@@ -114,7 +113,7 @@ int DoLoadPortalFileDialog(){
        button.show();
        hbox.pack_end(button, FALSE, FALSE, 0);
        button.connect( "clicked", G_CALLBACK( change_clicked ), entry );
-       gtk_widget_set_size_request( button, 60, -1 );
+       button.dimensions(60, -1);
 
        hbox = ui::HBox( FALSE, 5 );
        hbox.show();
@@ -125,14 +124,14 @@ int DoLoadPortalFileDialog(){
        hbox.pack_end(button, FALSE, FALSE, 0);
        button.connect( "clicked",
                                                G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) );
-       gtk_widget_set_size_request( button, 60, -1 );
+       button.dimensions(60, -1);
 
        button = ui::Button( "OK" );
        button.show();
        hbox.pack_end(button, FALSE, FALSE, 0);
        button.connect( "clicked",
                                                G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
-       gtk_widget_set_size_request( button, 60, -1 );
+       button.dimensions(60, -1);
 
        strcpy( portals.fn, GlobalRadiant().getMapName() );
        char* fn = strrchr( portals.fn, '.' );