]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - radiant/patchmanip.cpp
GTK: wrap gtk_box_pack_start
[xonotic/netradiant.git] / radiant / patchmanip.cpp
index 9c85927f98b6e007c808286e4e57f8ea507012ce..8f7c26a72f91a57fc8241a6e6fb6aba5bf988eac 100644 (file)
@@ -857,8 +857,8 @@ void DoNewPatchDlg( EPatchPrefab prefab, int minrows, int mincols, int defrows,
                auto hbox = create_dialog_hbox( 4, 4 );
                window.add(hbox);
                {
-                       GtkTable* table = create_dialog_table( 2, 2, 4, 4 );
-                       gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( table ), TRUE, TRUE, 0 );
+                       auto table = create_dialog_table( 2, 2, 4, 4 );
+                       hbox.pack_start( table, TRUE, TRUE, 0 );
                        {
                                auto label = ui::Label( "Width:" );
                                label.show();
@@ -878,7 +878,7 @@ void DoNewPatchDlg( EPatchPrefab prefab, int minrows, int mincols, int defrows,
 
                        {
                                auto combo = ui::ComboBoxText(ui::New);
-#define D_ITEM( x ) if ( x >= mincols && ( !maxcols || x <= maxcols ) ) gtk_combo_box_text_append_text( combo, # x )
+#define D_ITEM( x ) if ( x >= mincols && ( !maxcols || x <= maxcols ) ) gtk_combo_box_text_append_text( combo, #x )
                                D_ITEM( 3 );
                                D_ITEM( 5 );
                                D_ITEM( 7 );
@@ -904,7 +904,7 @@ void DoNewPatchDlg( EPatchPrefab prefab, int minrows, int mincols, int defrows,
                        }
                        {
                                auto combo = ui::ComboBoxText(ui::New);
-#define D_ITEM( x ) if ( x >= minrows && ( !maxrows || x <= maxrows ) ) gtk_combo_box_text_append_text( combo, # x )
+#define D_ITEM( x ) if ( x >= minrows && ( !maxrows || x <= maxrows ) ) gtk_combo_box_text_append_text( combo, #x )
                                D_ITEM( 3 );
                                D_ITEM( 5 );
                                D_ITEM( 7 );
@@ -931,18 +931,18 @@ void DoNewPatchDlg( EPatchPrefab prefab, int minrows, int mincols, int defrows,
                }
 
                {
-                       GtkVBox* vbox = create_dialog_vbox( 4 );
-                       gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( vbox ), TRUE, TRUE, 0 );
+                       auto vbox = create_dialog_vbox( 4 );
+                       hbox.pack_start( vbox, TRUE, TRUE, 0 );
                        {
                                auto button = create_dialog_button( "OK", G_CALLBACK( dialog_button_ok ), &dialog );
-                               gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( button ), FALSE, FALSE, 0 );
+                               vbox.pack_start( button, FALSE, FALSE, 0 );
                                widget_make_default( button );
                                gtk_widget_grab_focus( GTK_WIDGET( button ) );
                                gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_KEY_Return, (GdkModifierType)0, (GtkAccelFlags)0 );
                        }
                        {
-                               GtkButton* button = create_dialog_button( "Cancel", G_CALLBACK( dialog_button_cancel ), &dialog );
-                               gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( button ), FALSE, FALSE, 0 );
+                               auto button = create_dialog_button( "Cancel", G_CALLBACK( dialog_button_cancel ), &dialog );
+                               vbox.pack_start( button, FALSE, FALSE, 0 );
                                gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_KEY_Escape, (GdkModifierType)0, (GtkAccelFlags)0 );
                        }
                }
@@ -959,7 +959,7 @@ void DoNewPatchDlg( EPatchPrefab prefab, int minrows, int mincols, int defrows,
                Scene_PatchConstructPrefab( GlobalSceneGraph(), PatchCreator_getBounds(), TextureBrowser_GetSelectedShader( GlobalTextureBrowser() ), prefab, GlobalXYWnd_getCurrentViewType(), w, h );
        }
 
-       gtk_widget_destroy( GTK_WIDGET( window ) );
+       window.destroy();
 }
 
 
@@ -992,7 +992,7 @@ EMessageBoxReturn DoCapDlg( ECapDialog* type ){
                        {
                                auto table = ui::Table( 5, 2, FALSE );
                                table.show();
-                               gtk_box_pack_start( GTK_BOX( radio_vbox ), GTK_WIDGET( table ), TRUE, TRUE, 0 );
+                               radio_vbox.pack_start( table, TRUE, TRUE, 0 );
                                gtk_table_set_row_spacings( table, 5 );
                                gtk_table_set_col_spacings( table, 5 );
 
@@ -1087,17 +1087,17 @@ EMessageBoxReturn DoCapDlg( ECapDialog* type ){
                }
 
                {
-                       GtkVBox* vbox = create_dialog_vbox( 4 );
-                       gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( vbox ), FALSE, FALSE, 0 );
+                       auto vbox = create_dialog_vbox( 4 );
+                       hbox.pack_start( vbox, FALSE, FALSE, 0 );
                        {
                                auto button = create_modal_dialog_button( "OK", ok_button );
-                               gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( button ), FALSE, FALSE, 0 );
+                               vbox.pack_start( button, FALSE, FALSE, 0 );
                                widget_make_default( button );
                                gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel_group, GDK_KEY_Return, (GdkModifierType)0, GTK_ACCEL_VISIBLE );
                        }
                        {
-                               GtkButton* button = create_modal_dialog_button( "Cancel", cancel_button );
-                               gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( button ), FALSE, FALSE, 0 );
+                               auto button = create_modal_dialog_button( "Cancel", cancel_button );
+                               vbox.pack_start( button, FALSE, FALSE, 0 );
                                gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel_group, GDK_KEY_Escape, (GdkModifierType)0, GTK_ACCEL_VISIBLE );
                        }
                }
@@ -1125,7 +1125,7 @@ EMessageBoxReturn DoCapDlg( ECapDialog* type ){
                }
        }
 
-       gtk_widget_destroy( GTK_WIDGET( window ) );
+       window.destroy();
 
        return ret;
 }