]> git.xonotic.org Git - xonotic/netradiant.git/blobdiff - radiant/map.cpp
Purge gtk_container_add
[xonotic/netradiant.git] / radiant / map.cpp
index ba9d40211e98d8c705244b20423827769dec61be..fa54737a59f68b0943079a32e70890970e64b94d 100644 (file)
@@ -42,7 +42,6 @@ MapModules& ReferenceAPI_getMapModules();
 
 #include <set>
 
-#include <gtk/gtk.h>
 #include <gdk/gdkkeysyms.h>
 #include "uilib/uilib.h"
 
@@ -771,8 +770,8 @@ void DoMapInfo(){
        window_set_position( window, g_posMapInfoWnd );
 
        {
-               GtkVBox* vbox = create_dialog_vbox( 4, 4 );
-               gtk_container_add( GTK_CONTAINER( window ), GTK_WIDGET( vbox ) );
+               auto vbox = create_dialog_vbox( 4, 4 );
+               window.add(vbox);
 
                {
                        GtkHBox* hbox = create_dialog_hbox( 4 );
@@ -784,7 +783,7 @@ void DoMapInfo(){
 
                                {
                                        auto entry = ui::Entry();
-                                       gtk_widget_show( GTK_WIDGET( entry ) );
+                                       entry.show();
                                        gtk_table_attach( table, GTK_WIDGET( entry ), 1, 2, 0, 1,
                                                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
@@ -794,7 +793,7 @@ void DoMapInfo(){
                                }
                                {
                                        auto entry = ui::Entry();
-                                       gtk_widget_show( GTK_WIDGET( entry ) );
+                                       entry.show();
                                        gtk_table_attach( table, GTK_WIDGET( entry ), 1, 2, 1, 2,
                                                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
@@ -804,7 +803,7 @@ void DoMapInfo(){
                                }
                                {
                                        ui::Widget label = ui::Label( "Total Brushes" );
-                                       gtk_widget_show( label );
+                                       label.show();
                                        gtk_table_attach( GTK_TABLE( table ), label, 0, 1, 0, 1,
                                                                          (GtkAttachOptions) ( GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
@@ -812,7 +811,7 @@ void DoMapInfo(){
                                }
                                {
                                        ui::Widget label = ui::Label( "Total Entities" );
-                                       gtk_widget_show( label );
+                                       label.show();
                                        gtk_table_attach( GTK_TABLE( table ), label, 0, 1, 1, 2,
                                                                          (GtkAttachOptions) ( GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
@@ -831,12 +830,12 @@ void DoMapInfo(){
                }
                {
                        ui::Widget label = ui::Label( "Entity breakdown" );
-                       gtk_widget_show( label );
+                       label.show();
                        gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( label ), FALSE, TRUE, 0 );
                        gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
                }
                {
-                       GtkScrolledWindow* scr = create_scrolled_window( GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC, 4 );
+                       auto scr = create_scrolled_window( GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC, 4 );
                        gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( scr ), TRUE, TRUE, 0 );
 
                        {
@@ -859,9 +858,9 @@ void DoMapInfo(){
                                        gtk_tree_view_column_set_sort_column_id( column, 1 );
                                }
 
-                               gtk_widget_show( view );
+                               view.show();
 
-                               gtk_container_add( GTK_CONTAINER( scr ), view );
+                               scr.add(view);
 
                                EntityBreakdownWalker = store;
                        }
@@ -2044,28 +2043,28 @@ void DoFind(){
        window.add_accel_group( accel );
 
        {
-               GtkVBox* vbox = create_dialog_vbox( 4, 4 );
-               gtk_container_add( GTK_CONTAINER( window ), GTK_WIDGET( vbox ) );
+               auto vbox = create_dialog_vbox( 4, 4 );
+               window.add(vbox);
                {
                        GtkTable* table = create_dialog_table( 2, 2, 4, 4 );
                        gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( table ), TRUE, TRUE, 0 );
                        {
                                ui::Widget label = ui::Label( "Entity number" );
-                               gtk_widget_show( label );
+                               label.show();
                                gtk_table_attach( GTK_TABLE( table ), label, 0, 1, 0, 1,
                                                                  (GtkAttachOptions) ( 0 ),
                                                                  (GtkAttachOptions) ( 0 ), 0, 0 );
                        }
                        {
                                ui::Widget label = ui::Label( "Brush number" );
-                               gtk_widget_show( label );
+                               label.show();
                                gtk_table_attach( GTK_TABLE( table ), label, 0, 1, 1, 2,
                                                                  (GtkAttachOptions) ( 0 ),
                                                                  (GtkAttachOptions) ( 0 ), 0, 0 );
                        }
                        {
                                auto entry = ui::Entry();
-                               gtk_widget_show( GTK_WIDGET( entry ) );
+                               entry.show();
                                gtk_table_attach( table, GTK_WIDGET( entry ), 1, 2, 0, 1,
                                                                  (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                                                  (GtkAttachOptions) ( 0 ), 0, 0 );
@@ -2074,7 +2073,7 @@ void DoFind(){
                        }
                        {
                                auto entry = ui::Entry();
-                               gtk_widget_show( GTK_WIDGET( entry ) );
+                               entry.show();
                                gtk_table_attach( table, GTK_WIDGET( entry ), 1, 2, 1, 2,
                                                                  (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                                                  (GtkAttachOptions) ( 0 ), 0, 0 );
@@ -2086,9 +2085,9 @@ void DoFind(){
                        GtkHBox* hbox = create_dialog_hbox( 4 );
                        gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( hbox ), TRUE, TRUE, 0 );
                        {
-                               GtkButton* button = create_dialog_button( "Find", G_CALLBACK( dialog_button_ok ), &dialog );
+                               auto button = create_dialog_button( "Find", G_CALLBACK( dialog_button_ok ), &dialog );
                                gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( button ), FALSE, FALSE, 0 );
-                               widget_make_default( GTK_WIDGET( button ) );
+                               widget_make_default( button );
                                gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_KEY_Return, (GdkModifierType)0, (GtkAccelFlags)0 );
                        }
                        {