]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
Purge gtk_widget_show from radiant/*
authorTimePath <andrew.hardaker1995@gmail.com>
Fri, 21 Jul 2017 17:55:37 +0000 (03:55 +1000)
committerTimePath <andrew.hardaker1995@gmail.com>
Mon, 31 Jul 2017 12:35:47 +0000 (22:35 +1000)
21 files changed:
radiant/build.cpp
radiant/commands.cpp
radiant/console.cpp
radiant/dialog.cpp
radiant/entityinspector.cpp
radiant/entitylist.cpp
radiant/feedback.cpp
radiant/findtexturedialog.cpp
radiant/groupdialog.cpp
radiant/gtkdlgs.cpp
radiant/mainframe.cpp
radiant/map.cpp
radiant/mru.cpp
radiant/patchdialog.cpp
radiant/patchmanip.cpp
radiant/pluginmenu.cpp
radiant/plugintoolbar.cpp
radiant/preferences.cpp
radiant/select.cpp
radiant/surfacedialog.cpp
radiant/texwindow.cpp

index a77cde975da751fb88d258be3d18ff78a0bd550c..8fd89912447091d46b4ebc7b94b3bb5defeea85a 100644 (file)
@@ -883,7 +883,7 @@ ui::Window BuildMenuDialog_construct( ModalDialog& modal, ProjectList& projectLi
                                        GtkTreeSelection* selection = gtk_tree_view_get_selection( GTK_TREE_VIEW( view ) );
                                        gtk_tree_selection_set_mode( selection, GTK_SELECTION_BROWSE );
 
-                                       gtk_widget_show( view );
+                                       view.show();
 
                                        buildView = view;
                                        projectList.m_store = store;
@@ -920,7 +920,7 @@ ui::Window BuildMenuDialog_construct( ModalDialog& modal, ProjectList& projectLi
                                        GtkTreeSelection* selection = gtk_tree_view_get_selection( GTK_TREE_VIEW( view ) );
                                        gtk_tree_selection_set_mode( selection, GTK_SELECTION_BROWSE );
 
-                                       gtk_widget_show( view );
+                                       view.show();
 
                                        gtk_container_add( GTK_CONTAINER( scr ), view );
 
index 3c770f271c1364607ba4f209ebdcad7687a735f6..cce8b9db8ec03a34e1998dbd6234310165736861 100644 (file)
@@ -421,7 +421,7 @@ void DoCommandListDlg(){
                                gtk_tree_view_append_column( GTK_TREE_VIEW( view ), column );
                        }
 
-                       gtk_widget_show( view );
+                       view.show();
                        gtk_container_add( GTK_CONTAINER( scr ), view );
 
                        {
@@ -473,7 +473,7 @@ public:
                gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( clearbutton ), FALSE, FALSE, 0 );
 
                ui::Widget spacer = ui::Image();
-               gtk_widget_show( spacer );
+               spacer.show();
                gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( spacer ), TRUE, TRUE, 0 );
 
                auto button = create_modal_dialog_button( "Close", dialog.m_close_button );
index 53913149c94426fd8acb02719d6c7196ee5f380a..044648f9ff6467e3a882089c7a8a83e7fed43e27 100644 (file)
@@ -92,7 +92,7 @@ void console_populate_popup( GtkTextView* textview, ui::Menu menu, gpointer user
 
        ui::Widget item(ui::MenuItem( "Clear" ));
        g_signal_connect( G_OBJECT( item ), "activate", G_CALLBACK( console_clear ), 0 );
-       gtk_widget_show( item );
+       item.show();
        container_add_widget( menu, item );
 }
 
@@ -107,7 +107,7 @@ ui::Widget Console_constructWindow( ui::Window toplevel ){
        ui::Widget scr = ui::ScrolledWindow();
        gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( scr ), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC );
        gtk_scrolled_window_set_shadow_type( GTK_SCROLLED_WINDOW( scr ), GTK_SHADOW_IN );
-       gtk_widget_show( scr );
+       scr.show();
 
        {
                ui::Widget text = ui::TextView();
@@ -115,7 +115,7 @@ ui::Widget Console_constructWindow( ui::Window toplevel ){
                gtk_text_view_set_wrap_mode( GTK_TEXT_VIEW( text ), GTK_WRAP_WORD );
                gtk_text_view_set_editable( GTK_TEXT_VIEW( text ), FALSE );
                gtk_container_add( GTK_CONTAINER( scr ), text );
-               gtk_widget_show( text );
+               text.show();
                g_console = text;
 
                //globalExtendedASCIICharacterSet().print();
index fc35fd76015978035c063a4cb515de59a4217ac6..b3ba1f1a07a6885f37d1a73d86c9c42a5db19b4f 100644 (file)
@@ -47,7 +47,7 @@
 
 GtkEntry* DialogEntry_new(){
        auto entry = ui::Entry();
-       gtk_widget_show( GTK_WIDGET( entry ) );
+       entry.show();
        gtk_widget_set_size_request( GTK_WIDGET( entry ), 64, -1 );
        return entry;
 }
@@ -63,7 +63,7 @@ GtkEntry* m_entry;
 
 DialogEntryRow DialogEntryRow_new( const char* name ){
        ui::Widget alignment = ui::Alignment( 0.0, 0.5, 0.0, 0.0 );
-       gtk_widget_show( alignment );
+       alignment.show();
 
        GtkEntry* entry = DialogEntry_new();
        gtk_container_add( GTK_CONTAINER( alignment ), GTK_WIDGET( entry ) );
@@ -79,8 +79,8 @@ GtkSpinButton* DialogSpinner_new( double value, double lower, double upper, int
        {
                ++digits;
        }
-       GtkSpinButton* spin = ui::SpinButton( ui::Adjustment( value, lower, upper, step, 10, 0 ), step, digits );
-       gtk_widget_show( GTK_WIDGET( spin ) );
+       auto spin = ui::SpinButton( ui::Adjustment( value, lower, upper, step, 10, 0 ), step, digits );
+       spin.show();
        gtk_widget_set_size_request( GTK_WIDGET( spin ), 64, -1 );
        return spin;
 }
@@ -96,7 +96,7 @@ GtkSpinButton* m_spin;
 
 DialogSpinnerRow DialogSpinnerRow_new( const char* name, double value, double lower, double upper, int fraction ){
        ui::Widget alignment = ui::Alignment( 0.0, 0.5, 0.0, 0.0 );
-       gtk_widget_show( alignment );
+       alignment.show();
 
        GtkSpinButton* spin = DialogSpinner_new( value, lower, upper, fraction );
        gtk_container_add( GTK_CONTAINER( alignment ), GTK_WIDGET( spin ) );
@@ -311,7 +311,7 @@ Dialog::~Dialog(){
 void Dialog::ShowDlg(){
        ASSERT_MESSAGE( m_window, "dialog was not constructed" );
        importData();
-       gtk_widget_show( GTK_WIDGET( m_window ) );
+       m_window.show();
 }
 
 void Dialog::HideDlg(){
@@ -453,7 +453,7 @@ EMessageBoxReturn Dialog::DoModal(){
 
 ui::CheckButton Dialog::addCheckBox( ui::Widget vbox, const char* name, const char* flag, const BoolImportCallback& importViewer, const BoolExportCallback& exportViewer ){
        auto check = ui::CheckButton( flag );
-       gtk_widget_show( check );
+       check.show();
        AddBoolToggleData( *GTK_TOGGLE_BUTTON( check ), importViewer, exportViewer );
 
        DialogVBox_packRow( ui::VBox(GTK_VBOX( vbox )), ui::Widget(GTK_WIDGET( DialogRow_new( name, check ) ) ));
@@ -466,7 +466,7 @@ ui::CheckButton Dialog::addCheckBox( ui::Widget vbox, const char* name, const ch
 
 void Dialog::addCombo( ui::Widget vbox, const char* name, StringArrayRange values, const IntImportCallback& importViewer, const IntExportCallback& exportViewer ){
        ui::Widget alignment = ui::Alignment( 0.0, 0.5, 0.0, 0.0 );
-       gtk_widget_show( alignment );
+       alignment.show();
        {
                ui::Widget combo = ui::ComboBoxText();
 
@@ -477,7 +477,7 @@ void Dialog::addCombo( ui::Widget vbox, const char* name, StringArrayRange value
 
                AddIntComboData( *GTK_COMBO_BOX( combo ), importViewer, exportViewer );
 
-               gtk_widget_show( combo );
+               combo.show();
                gtk_container_add( GTK_CONTAINER( alignment ), combo );
        }
 
@@ -493,16 +493,16 @@ void Dialog::addSlider( ui::Widget vbox, const char* name, int& data, gboolean d
 #if 0
        if ( draw_value == FALSE ) {
                ui::Widget hbox2 = ui::HBox( FALSE, 0 );
-               gtk_widget_show( hbox2 );
+               hbox2.show();
                gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( hbox2 ), FALSE, FALSE, 0 );
                {
                        ui::Widget label = ui::Label( low );
-                       gtk_widget_show( label );
+                       label.show();
                        gtk_box_pack_start( GTK_BOX( hbox2 ), label, FALSE, FALSE, 0 );
                }
                {
                        ui::Widget label = ui::Label( high );
-                       gtk_widget_show( label );
+                       label.show();
                        gtk_box_pack_end( GTK_BOX( hbox2 ), label, FALSE, FALSE, 0 );
                }
        }
@@ -514,11 +514,11 @@ void Dialog::addSlider( ui::Widget vbox, const char* name, int& data, gboolean d
 
        // scale
        ui::Widget alignment = ui::Alignment( 0.0, 0.5, 1.0, 0.0 );
-       gtk_widget_show( alignment );
+       alignment.show();
 
        ui::Widget scale = ui::HScale( adj );
        gtk_scale_set_value_pos( GTK_SCALE( scale ), GTK_POS_LEFT );
-       gtk_widget_show( scale );
+       scale.show();
        gtk_container_add( GTK_CONTAINER( alignment ), scale );
 
        gtk_scale_set_draw_value( GTK_SCALE( scale ), draw_value );
@@ -530,7 +530,7 @@ void Dialog::addSlider( ui::Widget vbox, const char* name, int& data, gboolean d
 
 void Dialog::addRadio( ui::Widget vbox, const char* name, StringArrayRange names, const IntImportCallback& importViewer, const IntExportCallback& exportViewer ){
        ui::Widget alignment = ui::Alignment( 0.0, 0.5, 0.0, 0.0 );
-       gtk_widget_show( alignment );
+       alignment.show();;
        {
                RadioHBox radioBox = RadioHBox_new( names );
                gtk_container_add( GTK_CONTAINER( alignment ), GTK_WIDGET( radioBox.m_hbox ) );
@@ -547,7 +547,7 @@ void Dialog::addRadio( ui::Widget vbox, const char* name, int& data, StringArray
 
 void Dialog::addRadioIcons( ui::Widget vbox, const char* name, StringArrayRange icons, const IntImportCallback& importViewer, const IntExportCallback& exportViewer ){
        ui::Widget table = ui::Table( 2, icons.last - icons.first, FALSE );
-       gtk_widget_show( table );
+       table.show();;
 
        gtk_table_set_row_spacings( GTK_TABLE( table ), 5 );
        gtk_table_set_col_spacings( GTK_TABLE( table ), 5 );
@@ -557,14 +557,14 @@ void Dialog::addRadioIcons( ui::Widget vbox, const char* name, StringArrayRange
        for ( StringArrayRange::Iterator icon = icons.first; icon != icons.last; ++icon )
        {
                guint pos = static_cast<guint>( icon - icons.first );
-               GtkImage* image = new_local_image( *icon );
-               gtk_widget_show( GTK_WIDGET( image ) );
+               auto image = new_local_image( *icon );
+               image.show();
                gtk_table_attach( GTK_TABLE( table ), GTK_WIDGET( image ), pos, pos + 1, 0, 1,
                                                  (GtkAttachOptions) ( 0 ),
                                                  (GtkAttachOptions) ( 0 ), 0, 0 );
 
                radio = ui::Widget(gtk_radio_button_new( group ));
-               gtk_widget_show( radio );
+               radio.show();
                gtk_table_attach( GTK_TABLE( table ), radio, pos, pos + 1, 1, 2,
                                                  (GtkAttachOptions) ( 0 ),
                                                  (GtkAttachOptions) ( 0 ), 0, 0 );
index 616db701ebd011365dd43023b11ea0ba0ed2e33b..8e3e3e1d2c3eff08e26db4317d515ff535030031 100644 (file)
@@ -121,8 +121,8 @@ public:
 BooleanAttribute( const char* key ) :
        m_key( key ),
        m_check( 0 ){
-       GtkCheckButton* check = GTK_CHECK_BUTTON( gtk_check_button_new() );
-       gtk_widget_show( GTK_WIDGET( check ) );
+       auto check = ui::CheckButton(GTK_CHECK_BUTTON( gtk_check_button_new() ));
+       check.show();
 
        m_check = check;
 
@@ -167,7 +167,7 @@ StringAttribute( const char* key ) :
        m_entry( nullptr ),
        m_nonModal( ApplyCaller( *this ), UpdateCaller( *this ) ){
        auto entry = ui::Entry();
-       gtk_widget_show( GTK_WIDGET( entry ) );
+       entry.show();
        gtk_widget_set_size_request( GTK_WIDGET( entry ), 50, -1 );
 
        m_entry = entry;
@@ -370,7 +370,7 @@ ui::Entry m_entry;
 NonModalEntry m_nonModal;
 RadioHBox m_radio;
 NonModalRadio m_nonModalRadio;
-GtkHBox* m_hbox;
+ui::HBox m_hbox{nullptr};
 public:
 DirectionAttribute( const char* key ) :
        m_key( key ),
@@ -385,7 +385,7 @@ DirectionAttribute( const char* key ) :
        m_nonModalRadio.connect( m_radio.m_radio );
 
        m_hbox = ui::HBox( FALSE, 4 );
-       gtk_widget_show( GTK_WIDGET( m_hbox ) );
+       m_hbox.show();
 
        gtk_box_pack_start( GTK_BOX( m_hbox ), GTK_WIDGET( m_radio.m_hbox ), TRUE, TRUE, 0 );
        gtk_box_pack_start( GTK_BOX( m_hbox ), GTK_WIDGET( m_entry ), TRUE, TRUE, 0 );
@@ -473,7 +473,7 @@ AnglesAttribute( const char* key ) :
        m_nonModal( ApplyCaller( *this ), UpdateCaller( *this ) ),
        m_hbox(ui::HBox( TRUE, 4 ))
 {
-       gtk_widget_show( GTK_WIDGET( m_hbox ) );
+       m_hbox.show();
        {
                auto entry = numeric_entry_new();
                gtk_box_pack_start( m_hbox, GTK_WIDGET( entry ), TRUE, TRUE, 0 );
@@ -554,13 +554,13 @@ class Vector3Attribute : public EntityAttribute
 CopiedString m_key;
 Vector3Entry m_vector3;
 NonModalEntry m_nonModal;
-GtkBox* m_hbox;
+ui::Box m_hbox{nullptr};
 public:
 Vector3Attribute( const char* key ) :
        m_key( key ),
        m_nonModal( ApplyCaller( *this ), UpdateCaller( *this ) ){
        m_hbox = ui::HBox( TRUE, 4 );
-       gtk_widget_show( GTK_WIDGET( m_hbox ) );
+       m_hbox.show();
        {
                auto entry = numeric_entry_new();
                gtk_box_pack_start( m_hbox, GTK_WIDGET( entry ), TRUE, TRUE, 0 );
@@ -668,7 +668,7 @@ ListAttribute( const char* key, const ListAttributeType& type ) :
                gtk_combo_box_text_append_text( GTK_COMBO_BOX_TEXT( combo ), ( *i ).first.c_str() );
        }
 
-       gtk_widget_show( GTK_WIDGET( combo ) );
+       combo.show();
        m_nonModal.connect( combo );
 
        m_combo = combo;
@@ -873,7 +873,7 @@ void SurfaceFlags_setEntityClass( EntityClass* eclass ){
                for ( int i = 0; i < g_spawnflag_count; ++i )
                {
                        ui::Widget widget = ui::Widget(GTK_WIDGET( g_entitySpawnflagsCheck[i] ));
-                       gtk_widget_show( widget );
+                       widget.show();
 
                        StringOutputStream str( 16 );
                        str << LowerCase( eclass->flagnames[spawn_table[i]] );
@@ -1289,7 +1289,7 @@ void EntityInspector_destroyWindow( ui::Widget widget, gpointer data ){
 
 ui::Widget EntityInspector_constructWindow( ui::Window toplevel ){
        ui::Widget vbox = ui::VBox( FALSE, 2 );
-       gtk_widget_show( vbox );
+       vbox.show();
        gtk_container_set_border_width( GTK_CONTAINER( vbox ), 2 );
 
        g_signal_connect( G_OBJECT( vbox ), "destroy", G_CALLBACK( EntityInspector_destroyWindow ), 0 );
@@ -1297,21 +1297,21 @@ ui::Widget EntityInspector_constructWindow( ui::Window toplevel ){
        {
                ui::Widget split1 = ui::VPaned();
                gtk_box_pack_start( GTK_BOX( vbox ), split1, TRUE, TRUE, 0 );
-               gtk_widget_show( split1 );
+               split1.show();
 
                g_entity_split1 = split1;
 
                {
                        ui::Widget split2 = ui::VPaned();
                        gtk_paned_add1( GTK_PANED( split1 ), split2 );
-                       gtk_widget_show( split2 );
+                       split2.show();
 
                        g_entity_split2 = split2;
 
                        {
                                // class list
                                ui::Widget scr = ui::ScrolledWindow();
-                               gtk_widget_show( scr );
+                               scr.show();
                                gtk_paned_add1( GTK_PANED( split2 ), scr );
                                gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( scr ), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS );
                                gtk_scrolled_window_set_shadow_type( GTK_SCROLLED_WINDOW( scr ), GTK_SHADOW_IN );
@@ -1319,7 +1319,7 @@ ui::Widget EntityInspector_constructWindow( ui::Window toplevel ){
                                {
                                        ui::ListStore store = ui::ListStore(gtk_list_store_new( 2, G_TYPE_STRING, G_TYPE_POINTER ));
 
-                                       GtkTreeView* view = ui::TreeView( ui::TreeModel( GTK_TREE_MODEL( store ) ));
+                                       auto view = ui::TreeView( ui::TreeModel( GTK_TREE_MODEL( store ) ));
                                        gtk_tree_view_set_enable_search( GTK_TREE_VIEW( view ), FALSE );
                                        gtk_tree_view_set_headers_visible( view, FALSE );
                                        g_signal_connect( G_OBJECT( view ), "button_press_event", G_CALLBACK( EntityClassList_button_press ), 0 );
@@ -1336,7 +1336,7 @@ ui::Widget EntityInspector_constructWindow( ui::Window toplevel ){
                                                g_signal_connect( G_OBJECT( selection ), "changed", G_CALLBACK( EntityClassList_selection_changed ), 0 );
                                        }
 
-                                       gtk_widget_show( GTK_WIDGET( view ) );
+                                       view.show();
 
                                        gtk_container_add( GTK_CONTAINER( scr ), GTK_WIDGET( view ) );
 
@@ -1348,17 +1348,17 @@ ui::Widget EntityInspector_constructWindow( ui::Window toplevel ){
 
                        {
                                ui::Widget scr = ui::ScrolledWindow();
-                               gtk_widget_show( scr );
+                               scr.show();
                                gtk_paned_add2( GTK_PANED( split2 ), scr );
                                gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( scr ), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS );
                                gtk_scrolled_window_set_shadow_type( GTK_SCROLLED_WINDOW( scr ), GTK_SHADOW_IN );
 
                                {
-                                       GtkTextView* text = ui::TextView();
+                                       auto text = ui::TextView();
                                        gtk_widget_set_size_request( GTK_WIDGET( text ), 0, -1 ); // allow shrinking
                                        gtk_text_view_set_wrap_mode( text, GTK_WRAP_WORD );
                                        gtk_text_view_set_editable( text, FALSE );
-                                       gtk_widget_show( GTK_WIDGET( text ) );
+                                       text.show();
                                        gtk_container_add( GTK_CONTAINER( scr ), GTK_WIDGET( text ) );
                                        g_entityClassComment = text;
                                }
@@ -1368,18 +1368,18 @@ ui::Widget EntityInspector_constructWindow( ui::Window toplevel ){
                {
                        ui::Widget split2 = ui::VPaned();
                        gtk_paned_add2( GTK_PANED( split1 ), split2 );
-                       gtk_widget_show( split2 );
+                       split2.show();
 
                        {
                                ui::Widget vbox2 = ui::VBox( FALSE, 2 );
-                               gtk_widget_show( vbox2 );
+                               vbox2.show();
                                gtk_paned_pack1( GTK_PANED( split2 ), vbox2, FALSE, FALSE );
 
                                {
                                        // Spawnflags (4 colums wide max, or window gets too wide.)
-                                       GtkTable* table = ui::Table( 4, 4, FALSE );
+                                       auto table = ui::Table( 4, 4, FALSE );
                                        gtk_box_pack_start( GTK_BOX( vbox2 ), GTK_WIDGET( table ), FALSE, TRUE, 0 );
-                                       gtk_widget_show( GTK_WIDGET( table ) );
+                                       table.show();
 
                                        g_spawnflagsTable = table;
 
@@ -1395,7 +1395,7 @@ ui::Widget EntityInspector_constructWindow( ui::Window toplevel ){
                                {
                                        // key/value list
                                        ui::Widget scr = ui::ScrolledWindow();
-                                       gtk_widget_show( scr );
+                                       scr.show();
                                        gtk_box_pack_start( GTK_BOX( vbox2 ), scr, TRUE, TRUE, 0 );
                                        gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( scr ), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC );
                                        gtk_scrolled_window_set_shadow_type( GTK_SCROLLED_WINDOW( scr ), GTK_SHADOW_IN );
@@ -1424,7 +1424,7 @@ ui::Widget EntityInspector_constructWindow( ui::Window toplevel ){
                                                        g_signal_connect( G_OBJECT( selection ), "changed", G_CALLBACK( EntityProperties_selection_changed ), 0 );
                                                }
 
-                                               gtk_widget_show( view );
+                                               view.show();
 
                                                gtk_container_add( GTK_CONTAINER( scr ), view );
 
@@ -1436,15 +1436,15 @@ ui::Widget EntityInspector_constructWindow( ui::Window toplevel ){
 
                                {
                                        // key/value entry
-                                       GtkTable* table = ui::Table( 2, 2, FALSE );
-                                       gtk_widget_show( GTK_WIDGET( table ) );
+                                       auto table = ui::Table( 2, 2, FALSE );
+                                       table.show();
                                        gtk_box_pack_start( GTK_BOX( vbox2 ), GTK_WIDGET( table ), FALSE, TRUE, 0 );
                                        gtk_table_set_row_spacings( table, 3 );
                                        gtk_table_set_col_spacings( table, 5 );
 
                                        {
                                                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 );
@@ -1455,7 +1455,7 @@ ui::Widget EntityInspector_constructWindow( ui::Window toplevel ){
 
                                        {
                                                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 );
@@ -1465,8 +1465,8 @@ ui::Widget EntityInspector_constructWindow( ui::Window toplevel ){
                                        }
 
                                        {
-                                               GtkLabel* label = GTK_LABEL( ui::Label( "Value" ) );
-                                               gtk_widget_show( GTK_WIDGET( label ) );
+                                               auto label = ui::Label( "Value" );
+                                               label.show();
                                                gtk_table_attach( table, GTK_WIDGET( label ), 0, 1, 1, 2,
                                                                                  (GtkAttachOptions)( GTK_FILL ),
                                                                                  (GtkAttachOptions)( 0 ), 0, 0 );
@@ -1474,8 +1474,8 @@ ui::Widget EntityInspector_constructWindow( ui::Window toplevel ){
                                        }
 
                                        {
-                                               GtkLabel* label = GTK_LABEL( ui::Label( "Key" ) );
-                                               gtk_widget_show( GTK_WIDGET( label ) );
+                                               auto label = ui::Label( "Key" );
+                                               label.show();
                                                gtk_table_attach( table, GTK_WIDGET( label ), 0, 1, 0, 1,
                                                                                  (GtkAttachOptions)( GTK_FILL ),
                                                                                  (GtkAttachOptions)( 0 ), 0, 0 );
@@ -1484,19 +1484,19 @@ ui::Widget EntityInspector_constructWindow( ui::Window toplevel ){
                                }
 
                                {
-                                       GtkBox* hbox = ui::HBox( TRUE, 4 );
-                                       gtk_widget_show( GTK_WIDGET( hbox ) );
+                                       auto hbox = ui::HBox( TRUE, 4 );
+                                       hbox.show();
                                        gtk_box_pack_start( GTK_BOX( vbox2 ), GTK_WIDGET( hbox ), FALSE, TRUE, 0 );
 
                                        {
-                                               GtkButton* button = ui::Button( "Clear All" );
-                                               gtk_widget_show( GTK_WIDGET( button ) );
+                                               auto button = ui::Button( "Clear All" );
+                                               button.show();
                                                g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( EntityInspector_clearAllKeyValues ), 0 );
                                                gtk_box_pack_start( hbox, GTK_WIDGET( button ), TRUE, TRUE, 0 );
                                        }
                                        {
-                                               GtkButton* button = ui::Button( "Delete Key" );
-                                               gtk_widget_show( GTK_WIDGET( button ) );
+                                               auto button = ui::Button( "Delete Key" );
+                                               button.show();
                                                g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( EntityInspector_clearKeyValue ), 0 );
                                                gtk_box_pack_start( hbox, GTK_WIDGET( button ), TRUE, TRUE, 0 );
                                        }
@@ -1505,15 +1505,15 @@ ui::Widget EntityInspector_constructWindow( ui::Window toplevel ){
 
                        {
                                ui::Widget scr = ui::ScrolledWindow();
-                               gtk_widget_show( scr );
+                               scr.show();
                                gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( scr ), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC );
 
                                ui::Widget viewport = ui::Widget(gtk_viewport_new( 0, 0 ));
-                               gtk_widget_show( viewport );
+                               viewport.show();
                                gtk_viewport_set_shadow_type( GTK_VIEWPORT( viewport ), GTK_SHADOW_NONE );
 
                                g_attributeBox = ui::VBox( FALSE, 2 );
-                               gtk_widget_show( GTK_WIDGET( g_attributeBox ) );
+                               g_attributeBox.show();
 
                                gtk_container_add( GTK_CONTAINER( viewport ), GTK_WIDGET( g_attributeBox ) );
                                gtk_container_add( GTK_CONTAINER( scr ), viewport );
index 13be0988f32b4b2dccbf5b59d5bfbcf67f665bc3..0e97b6093bbd9114cf13e4577a6464455011b0c3 100644 (file)
@@ -312,7 +312,7 @@ void EntityList_constructWindow( ui::Window main_window ){
 
                        gtk_tree_view_append_column( GTK_TREE_VIEW( view ), column );
 
-                       gtk_widget_show( view );
+                       view.show();
                        gtk_container_add( GTK_CONTAINER( scr ), view );
                        getEntityList().m_tree_view = GTK_TREE_VIEW( view );
                }
index 1c88f3394ce606c95249d57cc905e02fb119e34e..3c6aaa5dcdef6b5651e26d30f9fa4b8a9a4f1997 100644 (file)
@@ -292,7 +292,7 @@ ui::Window CDbgDlg::BuildDialog(){
        ui::Window window = MainFrame_getWindow().create_floating_window("Q3Map debug window" );
 
        ui::Widget scr = ui::ScrolledWindow();
-       gtk_widget_show( scr );
+       scr.show();
        gtk_container_add( GTK_CONTAINER( window ), GTK_WIDGET( scr ) );
        gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( scr ), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC );
        gtk_scrolled_window_set_shadow_type( GTK_SCROLLED_WINDOW( scr ), GTK_SHADOW_IN );
@@ -315,7 +315,7 @@ ui::Window CDbgDlg::BuildDialog(){
                        g_signal_connect( G_OBJECT( selection ), "changed", G_CALLBACK( feedback_selection_changed ), NULL );
                }
 
-               gtk_widget_show( view );
+               view.show();
 
                gtk_container_add( GTK_CONTAINER( scr ), view );
 
index 8ca4466ce5af32e92b9366bf0b1f425d413b6c1d..57cce140d252703bb2388e308fbd011579a2b8da 100644 (file)
@@ -132,36 +132,36 @@ ui::Window FindTextureDialog::BuildDialog(){
        ui::Window dlg = ui::Window(create_floating_window( "Find / Replace Texture(s)", m_parent ));
 
        hbox = ui::HBox( FALSE, 5 );
-       gtk_widget_show( hbox );
+       hbox.show();
        gtk_container_add( GTK_CONTAINER( dlg ), GTK_WIDGET( hbox ) );
        gtk_container_set_border_width( GTK_CONTAINER( hbox ), 5 );
 
        vbox = ui::VBox( FALSE, 5 );
-       gtk_widget_show( vbox );
+       vbox.show();
        gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( vbox ), TRUE, TRUE, 0 );
 
        table = ui::Table( 2, 2, FALSE );
-       gtk_widget_show( table );
+       table.show();
        gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( table ), TRUE, TRUE, 0 );
        gtk_table_set_row_spacings( GTK_TABLE( table ), 5 );
        gtk_table_set_col_spacings( GTK_TABLE( table ), 5 );
 
        label = ui::Label( "Find:" );
-       gtk_widget_show( label );
+       label.show();
        gtk_table_attach( GTK_TABLE( table ), label, 0, 1, 0, 1,
                                          (GtkAttachOptions) ( GTK_FILL ),
                                          (GtkAttachOptions) ( 0 ), 0, 0 );
        gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
 
        label = ui::Label( "Replace:" );
-       gtk_widget_show( label );
+       label.show();
        gtk_table_attach( GTK_TABLE( table ), label, 0, 1, 1, 2,
                                          (GtkAttachOptions) ( GTK_FILL ),
                                          (GtkAttachOptions) ( 0 ), 0, 0 );
        gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
 
        entry = ui::Entry();
-       gtk_widget_show( entry );
+       entry.show();
        gtk_table_attach( GTK_TABLE( table ), entry, 1, 2, 0, 1,
                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                          (GtkAttachOptions) ( 0 ), 0, 0 );
@@ -171,7 +171,7 @@ ui::Window FindTextureDialog::BuildDialog(){
        GlobalTextureEntryCompletion::instance().connect( GTK_ENTRY( entry ) );
 
        entry = ui::Entry();
-       gtk_widget_show( entry );
+       entry.show();
        gtk_table_attach( GTK_TABLE( table ), entry, 1, 2, 1, 2,
                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                          (GtkAttachOptions) ( 0 ), 0, 0 );
@@ -181,23 +181,23 @@ ui::Window FindTextureDialog::BuildDialog(){
        GlobalTextureEntryCompletion::instance().connect( GTK_ENTRY( entry ) );
 
        check = ui::CheckButton( "Within selected brushes only" );
-       gtk_widget_show( check );
+       check.show();
        gtk_box_pack_start( GTK_BOX( vbox ), check, TRUE, TRUE, 0 );
        AddDialogData( *GTK_TOGGLE_BUTTON( check ), m_bSelectedOnly );
 
        vbox = ui::VBox( FALSE, 5 );
-       gtk_widget_show( vbox );
+       vbox.show();
        gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( vbox ), FALSE, FALSE, 0 );
 
        button = ui::Button( "Apply" );
-       gtk_widget_show( button );
+       button.show();
        gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 );
        g_signal_connect( G_OBJECT( button ), "clicked",
                                          G_CALLBACK( OnApply ), 0 );
        gtk_widget_set_size_request( button, 60, -1 );
 
        button = ui::Button( "Close" );
-       gtk_widget_show( button );
+       button.show();
        gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 );
        g_signal_connect( G_OBJECT( button ), "clicked",
                                          G_CALLBACK( OnClose ), 0 );
index 7e7b3285e3dd35188c0d25c7d12604cedb043b90..ce9e467d7c0b9befbd7d43b45d778ef34480a66d 100644 (file)
@@ -55,7 +55,7 @@ void Create( ui::Window parent );
 void Show(){
        // workaround for strange gtk behaviour - modifying the contents of a window while it is not visible causes the window position to change without sending a configure_event
        m_position_tracker.sync( m_window );
-       gtk_widget_show( GTK_WIDGET( m_window ) );
+       m_window.show();
 }
 void Hide(){
        gtk_widget_hide( GTK_WIDGET( m_window ) );
@@ -111,7 +111,7 @@ void GroupDlg::Create( ui::Window parent ){
 
        {
                ui::Widget notebook = ui::Widget(gtk_notebook_new());
-               gtk_widget_show( notebook );
+               notebook.show();
                gtk_container_add( GTK_CONTAINER( window ), notebook );
                gtk_notebook_set_tab_pos( GTK_NOTEBOOK( notebook ), GTK_POS_BOTTOM );
                m_pNotebook = notebook;
@@ -123,7 +123,7 @@ void GroupDlg::Create( ui::Window parent ){
 
 ui::Widget GroupDialog_addPage( const char* tabLabel, ui::Widget widget, const StringExportCallback& title ){
        ui::Widget w = ui::Label( tabLabel );
-       gtk_widget_show( w );
+       w.show();
        ui::Widget page = ui::Widget(gtk_notebook_get_nth_page( GTK_NOTEBOOK( g_GroupDlg.m_pNotebook ), gtk_notebook_insert_page( GTK_NOTEBOOK( g_GroupDlg.m_pNotebook ), widget, w, -1 ) ));
        g_pages.push_back( title );
 
@@ -173,7 +173,7 @@ void GroupDialog_showPage( ui::Widget page ){
        }
        else
        {
-               gtk_widget_show( GTK_WIDGET( g_GroupDlg.m_window ) );
+               g_GroupDlg.m_window.show();
                GroupDialog_setPage( page );
        }
 }
index d46ea32baa583427f6266bb67da1c13e6ca9d1f8..0888570d50dc91b46da77b1f109d3ff04cd501be 100644 (file)
@@ -229,8 +229,8 @@ ui::Window ProjectSettingsDialog_construct( ProjectSettingsDialog& dialog, Modal
                                gtk_container_add( GTK_CONTAINER( frame ), GTK_WIDGET( table2 ) );
 
                                {
-                                       GtkLabel* label = GTK_LABEL( ui::Label( "Select mod" ) );
-                                       gtk_widget_show( GTK_WIDGET( label ) );
+                                       auto label = ui::Label( "Select mod" );
+                                       label.show();
                                        gtk_table_attach( table2, GTK_WIDGET( label ), 0, 1, 0, 1,
                                                                          (GtkAttachOptions) ( GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
@@ -245,7 +245,7 @@ ui::Window ProjectSettingsDialog_construct( ProjectSettingsDialog& dialog, Modal
                                        }
                                        gtk_combo_box_text_append_text( dialog.game_combo.game_select, globalGameComboConfiguration().custom );
 
-                                       gtk_widget_show( GTK_WIDGET( dialog.game_combo.game_select ) );
+                                       dialog.game_combo.game_select.show();
                                        gtk_table_attach( table2, GTK_WIDGET( dialog.game_combo.game_select ), 1, 2, 0, 1,
                                                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
@@ -254,8 +254,8 @@ ui::Window ProjectSettingsDialog_construct( ProjectSettingsDialog& dialog, Modal
                                }
 
                                {
-                                       GtkLabel* label = GTK_LABEL( ui::Label( "fs_game" ) );
-                                       gtk_widget_show( GTK_WIDGET( label ) );
+                                       auto label = ui::Label( "fs_game" );
+                                       label.show();
                                        gtk_table_attach( table2, GTK_WIDGET( label ), 0, 1, 1, 2,
                                                                          (GtkAttachOptions) ( GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
@@ -263,7 +263,7 @@ ui::Window ProjectSettingsDialog_construct( ProjectSettingsDialog& dialog, Modal
                                }
                                {
                                        auto entry = ui::Entry();
-                                       gtk_widget_show( GTK_WIDGET( entry ) );
+                                       entry.show();
                                        gtk_table_attach( table2, GTK_WIDGET( entry ), 1, 2, 1, 2,
                                                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
@@ -272,8 +272,8 @@ ui::Window ProjectSettingsDialog_construct( ProjectSettingsDialog& dialog, Modal
                                }
 
                                if ( globalMappingMode().do_mapping_mode ) {
-                                       GtkLabel* label = GTK_LABEL( ui::Label( "Mapping mode" ) );
-                                       gtk_widget_show( GTK_WIDGET( label ) );
+                                       auto label = ui::Label( "Mapping mode" );
+                                       label.show();
                                        gtk_table_attach( table2, GTK_WIDGET( label ), 0, 1, 3, 4,
                                                                          (GtkAttachOptions) ( GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
@@ -283,7 +283,7 @@ ui::Window ProjectSettingsDialog_construct( ProjectSettingsDialog& dialog, Modal
                                        gtk_combo_box_text_append_text( combo, globalMappingMode().sp_mapping_mode );
                                        gtk_combo_box_text_append_text( combo, globalMappingMode().mp_mapping_mode );
 
-                                       gtk_widget_show( GTK_WIDGET( combo ) );
+                                       combo.show();
                                        gtk_table_attach( table2, GTK_WIDGET( combo ), 1, 2, 3, 4,
                                                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
@@ -377,13 +377,13 @@ void DoSides( int type, int axis ){
                GtkHBox* hbox = create_dialog_hbox( 4, 4 );
                gtk_container_add( GTK_CONTAINER( window ), GTK_WIDGET( hbox ) );
                {
-                       GtkLabel* label = GTK_LABEL( ui::Label( "Sides:" ) );
-                       gtk_widget_show( GTK_WIDGET( label ) );
+                       auto label = ui::Label( "Sides:" );
+                       label.show();
                        gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( label ), FALSE, FALSE, 0 );
                }
                {
                        auto entry = ui::Entry();
-                       gtk_widget_show( GTK_WIDGET( entry ) );
+                       entry.show();
                        gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( entry ), FALSE, FALSE, 0 );
                        sides_entry = entry;
                        gtk_widget_grab_focus( GTK_WIDGET( entry ) );
@@ -456,8 +456,8 @@ void DoAbout(){
                                        GtkFrame* frame = create_dialog_frame( 0, GTK_SHADOW_IN );
                                        gtk_box_pack_start( GTK_BOX( vbox2 ), GTK_WIDGET( frame ), FALSE, FALSE, 0 );
                                        {
-                                               GtkImage* image = new_local_image( "logo.png" );
-                                               gtk_widget_show( GTK_WIDGET( image ) );
+                                               auto image = new_local_image( "logo.png" );
+                                               image.show();
                                                gtk_container_add( GTK_CONTAINER( frame ), GTK_WIDGET( image ) );
                                        }
                                }
@@ -473,9 +473,9 @@ void DoAbout(){
                                                                                "you may report your problems at\n"
                                                                                "https://gitlab.com/xonotic/netradiant/issues";
 
-                               GtkLabel* label = GTK_LABEL( ui::Label( label_text ) );
+                               auto label = ui::Label( label_text );
 
-                               gtk_widget_show( GTK_WIDGET( label ) );
+                               label.show();
                                gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( label ), FALSE, FALSE, 0 );
                                gtk_misc_set_alignment( GTK_MISC( label ), 1, 0.5 );
                                gtk_label_set_justify( label, GTK_JUSTIFY_LEFT );
@@ -509,48 +509,48 @@ void DoAbout(){
                                GtkTable* table = create_dialog_table( 3, 2, 4, 4, 4 );
                                gtk_container_add( GTK_CONTAINER( frame ), GTK_WIDGET( table ) );
                                {
-                                       GtkLabel* label = GTK_LABEL( ui::Label( "Vendor:" ) );
-                                       gtk_widget_show( GTK_WIDGET( label ) );
+                                       auto label = ui::Label( "Vendor:" );
+                                       label.show();
                                        gtk_table_attach( table, GTK_WIDGET( label ), 0, 1, 0, 1,
                                                                          (GtkAttachOptions) ( GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
                                        gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
                                }
                                {
-                                       GtkLabel* label = GTK_LABEL( ui::Label( "Version:" ) );
-                                       gtk_widget_show( GTK_WIDGET( label ) );
+                                       auto label = ui::Label( "Version:" );
+                                       label.show();
                                        gtk_table_attach( table, GTK_WIDGET( label ), 0, 1, 1, 2,
                                                                          (GtkAttachOptions) ( GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
                                        gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
                                }
                                {
-                                       GtkLabel* label = GTK_LABEL( ui::Label( "Renderer:" ) );
-                                       gtk_widget_show( GTK_WIDGET( label ) );
+                                       auto label = ui::Label( "Renderer:" );
+                                       label.show();
                                        gtk_table_attach( table, GTK_WIDGET( label ), 0, 1, 2, 3,
                                                                          (GtkAttachOptions) ( GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
                                        gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
                                }
                                {
-                                       GtkLabel* label = GTK_LABEL( ui::Label( reinterpret_cast<const char*>( glGetString( GL_VENDOR ) ) ) );
-                                       gtk_widget_show( GTK_WIDGET( label ) );
+                                       auto label = ui::Label( reinterpret_cast<const char*>( glGetString( GL_VENDOR ) ) );
+                                       label.show();
                                        gtk_table_attach( table, GTK_WIDGET( label ), 1, 2, 0, 1,
                                                                          (GtkAttachOptions) ( GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
                                        gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
                                }
                                {
-                                       GtkLabel* label = GTK_LABEL( ui::Label( reinterpret_cast<const char*>( glGetString( GL_VERSION ) ) ) );
-                                       gtk_widget_show( GTK_WIDGET( label ) );
+                                       auto label = ui::Label( reinterpret_cast<const char*>( glGetString( GL_VERSION ) ) );
+                                       label.show();
                                        gtk_table_attach( table, GTK_WIDGET( label ), 1, 2, 1, 2,
                                                                          (GtkAttachOptions) ( GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
                                        gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
                                }
                                {
-                                       GtkLabel* label = GTK_LABEL( ui::Label( reinterpret_cast<const char*>( glGetString( GL_RENDERER ) ) ) );
-                                       gtk_widget_show( GTK_WIDGET( label ) );
+                                       auto label = ui::Label( reinterpret_cast<const char*>( glGetString( GL_RENDERER ) ) );
+                                       label.show();
                                        gtk_table_attach( table, GTK_WIDGET( label ), 1, 2, 2, 3,
                                                                          (GtkAttachOptions) ( GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
@@ -570,7 +570,7 @@ void DoAbout(){
                                                GtkTextBuffer* buffer = gtk_text_view_get_buffer( GTK_TEXT_VIEW( text_extensions ) );
                                                gtk_text_buffer_set_text( buffer, reinterpret_cast<const char*>( glGetString( GL_EXTENSIONS ) ), -1 );
                                                gtk_text_view_set_wrap_mode( GTK_TEXT_VIEW( text_extensions ), GTK_WRAP_WORD );
-                                               gtk_widget_show( text_extensions );
+                                               text_extensions.show();
                                        }
                                }
                        }
@@ -608,29 +608,29 @@ EMessageBoxReturn DoTextureLayout( float *fx, float *fy ){
                        GtkVBox* vbox = create_dialog_vbox( 4 );
                        gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( vbox ), TRUE, TRUE, 0 );
                        {
-                               GtkLabel* label = GTK_LABEL( ui::Label( "Texture will be fit across the patch based\n"
+                               auto label = ui::Label( "Texture will be fit across the patch based\n"
                                                                                                                        "on the x and y values given. Values of 1x1\n"
                                                                                                                        "will \"fit\" the texture. 2x2 will repeat\n"
-                                                                                                                       "it twice, etc." ) );
-                               gtk_widget_show( GTK_WIDGET( label ) );
+                                                                                                                       "it twice, etc." );
+                               label.show();
                                gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( label ), TRUE, TRUE, 0 );
                                gtk_label_set_justify( label, GTK_JUSTIFY_LEFT );
                        }
                        {
-                               GtkTable* table = create_dialog_table( 2, 2, 4, 4 );
-                               gtk_widget_show( GTK_WIDGET( table ) );
+                               auto table = create_dialog_table( 2, 2, 4, 4 );
+                               table.show();
                                gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( table ), TRUE, TRUE, 0 );
                                {
-                                       GtkLabel* label = GTK_LABEL( ui::Label( "Texture x:" ) );
-                                       gtk_widget_show( GTK_WIDGET( label ) );
+                                       auto label = ui::Label( "Texture x:" );
+                                       label.show();
                                        gtk_table_attach( table, GTK_WIDGET( label ), 0, 1, 0, 1,
                                                                          (GtkAttachOptions) ( GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
                                        gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
                                }
                                {
-                                       GtkLabel* label = GTK_LABEL( ui::Label( "Texture y:" ) );
-                                       gtk_widget_show( GTK_WIDGET( label ) );
+                                       auto label = ui::Label( "Texture y:" );
+                                       label.show();
                                        gtk_table_attach( table, GTK_WIDGET( label ), 0, 1, 1, 2,
                                                                          (GtkAttachOptions) ( GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
@@ -638,7 +638,7 @@ EMessageBoxReturn DoTextureLayout( float *fx, float *fy ){
                                }
                                {
                                        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 );
@@ -647,7 +647,7 @@ EMessageBoxReturn DoTextureLayout( float *fx, float *fy ){
                                }
                                {
                                        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 );
@@ -750,35 +750,35 @@ static void CreateGtkTextEditor(){
        gtk_window_set_default_size( GTK_WINDOW( dlg ), 600, 300 );
 
        vbox = ui::VBox( FALSE, 5 );
-       gtk_widget_show( vbox );
+       vbox.show();
        gtk_container_add( GTK_CONTAINER( dlg ), GTK_WIDGET( vbox ) );
        gtk_container_set_border_width( GTK_CONTAINER( vbox ), 5 );
 
        scr = ui::ScrolledWindow();
-       gtk_widget_show( scr );
+       scr.show();
        gtk_box_pack_start( GTK_BOX( vbox ), scr, TRUE, TRUE, 0 );
        gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( scr ), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC );
        gtk_scrolled_window_set_shadow_type( GTK_SCROLLED_WINDOW( scr ), GTK_SHADOW_IN );
 
        text = ui::TextView();
        gtk_container_add( GTK_CONTAINER( scr ), text );
-       gtk_widget_show( text );
+       text.show();
        g_object_set_data( G_OBJECT( dlg ), "text", (gpointer) text );
        gtk_text_view_set_editable( GTK_TEXT_VIEW( text ), TRUE );
 
        hbox = ui::HBox( FALSE, 5 );
-       gtk_widget_show( hbox );
+       hbox.show();
        gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( hbox ), FALSE, TRUE, 0 );
 
        button = ui::Button( "Close" );
-       gtk_widget_show( button );
+       button.show();
        gtk_box_pack_end( GTK_BOX( hbox ), button, FALSE, FALSE, 0 );
        g_signal_connect( G_OBJECT( button ), "clicked",
                                          G_CALLBACK( editor_close ), dlg );
        gtk_widget_set_size_request( button, 60, -1 );
 
        button = ui::Button( "Save" );
-       gtk_widget_show( button );
+       button.show();
        gtk_box_pack_end( GTK_BOX( hbox ), button, FALSE, FALSE, 0 );
        g_signal_connect( G_OBJECT( button ), "clicked",
                                          G_CALLBACK( editor_save ), dlg );
@@ -822,7 +822,7 @@ static void DoGtkTextEditor( const char* filename, guint cursorpos ){
                g_object_set_data( G_OBJECT( text_editor ), "filename", strdup( filename ) );
 
                // trying to show later
-               gtk_widget_show( text_editor );
+               text_editor.show();
 
 #ifdef WIN32
                process_gui();
@@ -869,13 +869,13 @@ EMessageBoxReturn DoLightIntensityDlg( int *intensity ){
                        GtkVBox* vbox = create_dialog_vbox( 4 );
                        gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( vbox ), TRUE, TRUE, 0 );
                        {
-                               GtkLabel* label = GTK_LABEL( ui::Label( "ESC for default, ENTER to validate" ) );
-                               gtk_widget_show( GTK_WIDGET( label ) );
+                               auto label = ui::Label( "ESC for default, ENTER to validate" );
+                               label.show();
                                gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( label ), FALSE, FALSE, 0 );
                        }
                        {
                                auto entry = ui::Entry();
-                               gtk_widget_show( GTK_WIDGET( entry ) );
+                               entry.show();
                                gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( entry ), TRUE, TRUE, 0 );
 
                                gtk_widget_grab_focus( GTK_WIDGET( entry ) );
@@ -937,13 +937,13 @@ EMessageBoxReturn DoShaderTagDlg( CopiedString* tag, char* title ){
                        gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( vbox ), TRUE, TRUE, 0 );
                        {
                                //GtkLabel* label = GTK_LABEL(gtk_label_new("Enter one ore more tags separated by spaces"));
-                               GtkLabel* label = GTK_LABEL( ui::Label( "ESC to cancel, ENTER to validate" ) );
-                               gtk_widget_show( GTK_WIDGET( label ) );
+                               auto label = ui::Label( "ESC to cancel, ENTER to validate" );
+                               label.show();
                                gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( label ), FALSE, FALSE, 0 );
                        }
                        {
                                auto entry = ui::Entry();
-                               gtk_widget_show( GTK_WIDGET( entry ) );
+                               entry.show();
                                gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( entry ), TRUE, TRUE, 0 );
 
                                gtk_widget_grab_focus( GTK_WIDGET( entry ) );
@@ -995,23 +995,23 @@ EMessageBoxReturn DoShaderInfoDlg( const char* name, const char* filename, char*
                        GtkVBox* vbox = create_dialog_vbox( 4 );
                        gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( vbox ), FALSE, FALSE, 0 );
                        {
-                               GtkLabel* label = GTK_LABEL( ui::Label( "The selected shader" ) );
-                               gtk_widget_show( GTK_WIDGET( label ) );
+                               auto label = ui::Label( "The selected shader" );
+                               label.show();
                                gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( label ), FALSE, FALSE, 0 );
                        }
                        {
-                               GtkLabel* label = GTK_LABEL( ui::Label( name ) );
-                               gtk_widget_show( GTK_WIDGET( label ) );
+                               auto label = ui::Label( name );
+                               label.show();
                                gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( label ), FALSE, FALSE, 0 );
                        }
                        {
-                               GtkLabel* label = GTK_LABEL( ui::Label( "is located in file" ) );
-                               gtk_widget_show( GTK_WIDGET( label ) );
+                               auto label = ui::Label( "is located in file" );
+                               label.show();
                                gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( label ), FALSE, FALSE, 0 );
                        }
                        {
-                               GtkLabel* label = GTK_LABEL( ui::Label( filename ) );
-                               gtk_widget_show( GTK_WIDGET( label ) );
+                               auto label = ui::Label( filename );
+                               label.show();
                                gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( label ), FALSE, FALSE, 0 );
                        }
                        {
index 6858aa2c288d9a525e36a22642dda76dfa92ba9f..e9378d47b238c3f7acc579367071e1712e92d4e2 100644 (file)
@@ -1618,7 +1618,7 @@ class WaitDialog
 {
 public:
 ui::Window m_window;
-GtkLabel* m_label;
+ui::Label m_label{(GtkLabel *) nullptr};
 };
 
 WaitDialog create_wait_dialog( const char* title, const char* text ){
@@ -1632,10 +1632,10 @@ WaitDialog create_wait_dialog( const char* title, const char* text ){
        g_signal_connect( G_OBJECT( dialog.m_window ), "realize", G_CALLBACK( window_realize_remove_decoration ), 0 );
 
        {
-               dialog.m_label = GTK_LABEL( ui::Label( text ) );
+               dialog.m_label = ui::Label( text );
                gtk_misc_set_alignment( GTK_MISC( dialog.m_label ), 0.0, 0.5 );
                gtk_label_set_justify( dialog.m_label, GTK_JUSTIFY_LEFT );
-               gtk_widget_show( GTK_WIDGET( dialog.m_label ) );
+               dialog.m_label.show();
                gtk_widget_set_size_request( GTK_WIDGET( dialog.m_label ), 200, -1 );
 
                gtk_container_add( GTK_CONTAINER( dialog.m_window ), GTK_WIDGET( dialog.m_label ) );
@@ -1700,7 +1700,7 @@ void ScreenUpdates_Disable( const char* message, const char* title ){
                gtk_grab_add( GTK_WIDGET( g_wait.m_window ) );
 
                if ( isActiveApp ) {
-                       gtk_widget_show( GTK_WIDGET( g_wait.m_window ) );
+                       g_wait.m_window.show();
                        ScreenUpdates_process();
                }
        }
@@ -2172,21 +2172,21 @@ GtkMenuItem* create_help_menu(){
 }
 
 GtkMenuBar* create_main_menu( MainFrame::EViewStyle style ){
-       GtkMenuBar* menu_bar = GTK_MENU_BAR( gtk_menu_bar_new() );
-       gtk_widget_show( GTK_WIDGET( menu_bar ) );
-
-       gtk_container_add( GTK_CONTAINER( menu_bar ), GTK_WIDGET( create_file_menu() ) );
-       gtk_container_add( GTK_CONTAINER( menu_bar ), GTK_WIDGET( create_edit_menu() ) );
-       gtk_container_add( GTK_CONTAINER( menu_bar ), GTK_WIDGET( create_view_menu( style ) ) );
-       gtk_container_add( GTK_CONTAINER( menu_bar ), GTK_WIDGET( create_selection_menu() ) );
-       gtk_container_add( GTK_CONTAINER( menu_bar ), GTK_WIDGET( create_bsp_menu() ) );
-       gtk_container_add( GTK_CONTAINER( menu_bar ), GTK_WIDGET( create_grid_menu() ) );
-       gtk_container_add( GTK_CONTAINER( menu_bar ), GTK_WIDGET( create_misc_menu() ) );
-       gtk_container_add( GTK_CONTAINER( menu_bar ), GTK_WIDGET( create_entity_menu() ) );
-       gtk_container_add( GTK_CONTAINER( menu_bar ), GTK_WIDGET( create_brush_menu() ) );
-       gtk_container_add( GTK_CONTAINER( menu_bar ), GTK_WIDGET( create_patch_menu() ) );
-       gtk_container_add( GTK_CONTAINER( menu_bar ), GTK_WIDGET( create_plugins_menu() ) );
-       gtk_container_add( GTK_CONTAINER( menu_bar ), GTK_WIDGET( create_help_menu() ) );
+       auto menu_bar = ui::MenuBar(GTK_MENU_BAR( gtk_menu_bar_new() ));
+       menu_bar.show();
+
+       gtk_container_add( menu_bar, GTK_WIDGET( create_file_menu() ) );
+       gtk_container_add( menu_bar, GTK_WIDGET( create_edit_menu() ) );
+       gtk_container_add( menu_bar, GTK_WIDGET( create_view_menu( style ) ) );
+       gtk_container_add( menu_bar, GTK_WIDGET( create_selection_menu() ) );
+       gtk_container_add( menu_bar, GTK_WIDGET( create_bsp_menu() ) );
+       gtk_container_add( menu_bar, GTK_WIDGET( create_grid_menu() ) );
+       gtk_container_add( menu_bar, GTK_WIDGET( create_misc_menu() ) );
+       gtk_container_add( menu_bar, GTK_WIDGET( create_entity_menu() ) );
+       gtk_container_add( menu_bar, GTK_WIDGET( create_brush_menu() ) );
+       gtk_container_add( menu_bar, GTK_WIDGET( create_patch_menu() ) );
+       gtk_container_add( menu_bar, GTK_WIDGET( create_plugins_menu() ) );
+       gtk_container_add( menu_bar, GTK_WIDGET( create_help_menu() ) );
 
        return menu_bar;
 }
@@ -2323,12 +2323,12 @@ ui::Toolbar create_main_toolbar( MainFrame::EViewStyle style ){
        gtk_orientable_set_orientation( GTK_ORIENTABLE(toolbar), GTK_ORIENTATION_HORIZONTAL );
        gtk_toolbar_set_style( toolbar, GTK_TOOLBAR_ICONS );
 
-       gtk_widget_show( GTK_WIDGET( toolbar ) );
+       toolbar.show();
 
        auto space = [&]() {
-               auto btn = gtk_separator_tool_item_new();
-               gtk_widget_show(GTK_WIDGET(btn));
-               gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(btn));
+               auto btn = ui::Widget(GTK_WIDGET(gtk_separator_tool_item_new()));
+               btn.show();
+               gtk_container_add(toolbar, btn);
        };
 
        File_constructToolbar( toolbar );
@@ -2399,30 +2399,30 @@ ui::Toolbar create_main_toolbar( MainFrame::EViewStyle style ){
 }
 
 ui::Widget create_main_statusbar( ui::Widget pStatusLabel[c_count_status] ){
-       GtkTable* table = ui::Table( 1, c_count_status, FALSE );
-       gtk_widget_show( GTK_WIDGET( table ) );
+       auto table = ui::Table( 1, c_count_status, FALSE );
+       table.show();
 
        {
-               GtkLabel* label = GTK_LABEL( ui::Label( "Label" ) );
+               auto label = ui::Label( "Label" );
                gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
                gtk_misc_set_padding( GTK_MISC( label ), 4, 2 );
-               gtk_widget_show( GTK_WIDGET( label ) );
+               label.show();
                gtk_table_attach_defaults( table, GTK_WIDGET( label ), 0, 1, 0, 1 );
                pStatusLabel[c_command_status] = ui::Widget(GTK_WIDGET( label ));
        }
 
        for ( int i = 1; i < c_count_status; ++i )
        {
-               GtkFrame* frame = ui::Frame();
-               gtk_widget_show( GTK_WIDGET( frame ) );
+               auto frame = ui::Frame();
+               frame.show();
                gtk_table_attach_defaults( table, GTK_WIDGET( frame ), i, i + 1, 0, 1 );
                gtk_frame_set_shadow_type( frame, GTK_SHADOW_IN );
 
-               GtkLabel* label = GTK_LABEL( ui::Label( "Label" ) );
+               auto label = ui::Label( "Label" );
                gtk_label_set_ellipsize( label, PANGO_ELLIPSIZE_END );
                gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
                gtk_misc_set_padding( GTK_MISC( label ), 4, 2 );
-               gtk_widget_show( GTK_WIDGET( label ) );
+               label.show();
                gtk_container_add( GTK_CONTAINER( frame ), GTK_WIDGET( label ) );
                pStatusLabel[i] = ui::Widget(GTK_WIDGET( label ));
        }
@@ -2476,7 +2476,7 @@ class MainWindowActive
 {
 static gboolean notify( ui::Window window, gpointer dummy, MainWindowActive* self ){
        if ( g_wait.m_window && gtk_window_is_active( window ) && !gtk_widget_get_visible( g_wait.m_window ) ) {
-               gtk_widget_show( GTK_WIDGET( g_wait.m_window ) );
+               g_wait.m_window.show();
        }
 
        return FALSE;
@@ -2676,12 +2676,12 @@ ui::Window create_splash(){
        gtk_window_set_position( window, GTK_WIN_POS_CENTER );
        gtk_container_set_border_width( GTK_CONTAINER( window ), 0 );
 
-       GtkImage* image = new_local_image( "splash.png" );
-       gtk_widget_show( GTK_WIDGET( image ) );
+       auto image = new_local_image( "splash.png" );
+       image.show();
        gtk_container_add( GTK_CONTAINER( window ), GTK_WIDGET( image ) );
 
        gtk_widget_set_size_request( GTK_WIDGET( window ), -1, -1 );
-       gtk_widget_show( GTK_WIDGET( window ) );
+       window.show();
 
        return window;
 }
@@ -2744,7 +2744,7 @@ void MainFrame::Create(){
 
        ui::Widget vbox = ui::VBox( FALSE, 0 );
        gtk_container_add( GTK_CONTAINER( window ), vbox );
-       gtk_widget_show( vbox );
+       vbox.show();
 
        global_accel_connect_window( window );
 
@@ -2793,14 +2793,14 @@ void MainFrame::Create(){
 
        m_window = window;
 
-       gtk_widget_show( GTK_WIDGET( window ) );
+       window.show();
 
        if ( CurrentStyle() == eRegular || CurrentStyle() == eRegularLeft ) {
                {
                        ui::Widget vsplit = ui::VPaned();
                        m_vSplit = vsplit;
                        gtk_box_pack_start( GTK_BOX( vbox ), vsplit, TRUE, TRUE, 0 );
-                       gtk_widget_show( vsplit );
+                       vsplit.show();
 
                        // console
                        ui::Widget console_window = Console_constructWindow( window );
@@ -2808,7 +2808,7 @@ void MainFrame::Create(){
 
                        {
                                ui::Widget hsplit = ui::HPaned();
-                               gtk_widget_show( hsplit );
+                               hsplit.show();
                                m_hSplit = hsplit;
                                gtk_paned_add1( GTK_PANED( vsplit ), hsplit );
 
@@ -2819,7 +2819,7 @@ void MainFrame::Create(){
 
                                {
                                        ui::Widget vsplit2 = ui::VPaned();
-                                       gtk_widget_show( vsplit2 );
+                                       vsplit2.show();
                                        m_vSplit2 = vsplit2;
 
                                        if ( CurrentStyle() == eRegular ) {
@@ -2867,7 +2867,7 @@ void MainFrame::Create(){
                        global_accel_connect_window( window );
                        g_posCamWnd.connect( window );
 
-                       gtk_widget_show( GTK_WIDGET( window ) );
+                       window.show();
 
                        m_pCamWnd = NewCamWnd();
                        GlobalCamera_setCamWnd( *m_pCamWnd );
index cdcb1afeefcf1cc5e60a1e63955d3d46821d0f07..244001ea15455fe3f3817442d399feb448a52791 100644 (file)
@@ -783,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 );
@@ -793,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 );
@@ -803,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 );
@@ -811,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 );
@@ -830,7 +830,7 @@ 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 );
                }
@@ -858,7 +858,7 @@ 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 );
 
@@ -2050,21 +2050,21 @@ void DoFind(){
                        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 );
@@ -2073,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 );
index 085ca953501350424cd44b4da19c71d7f2755aa7..50d89bf1c0ad29db4760fc5693445b65239a37e5 100644 (file)
@@ -121,7 +121,7 @@ void MRU_AddFile( const char *str ){
 
        MRU_SetText( 0, str );
        gtk_widget_set_sensitive( GTK_WIDGET( MRU_items[0] ), TRUE );
-       gtk_widget_show( GTK_WIDGET( MRU_items[MRU_used - 1] ) );
+       ui::Widget(GTK_WIDGET( MRU_items[MRU_used - 1] )).show();
 }
 
 void MRU_Init(){
@@ -136,7 +136,7 @@ void MRU_AddWidget( GtkMenuItem *widget, std::size_t pos ){
                if ( pos < MRU_used ) {
                        MRU_updateWidget( pos, MRU_GetText( pos ) );
                        gtk_widget_set_sensitive( GTK_WIDGET( MRU_items[0] ), TRUE );
-                       gtk_widget_show( GTK_WIDGET( MRU_items[pos] ) );
+                       ui::Widget(GTK_WIDGET( MRU_items[pos] )).show();
                }
        }
 }
index 3e8e9487e729f026531a83687398b488415a492d..2c12c5bf09027579e4c82a716bf375a261df41b1 100644 (file)
@@ -563,44 +563,44 @@ ui::Window PatchInspector::BuildDialog(){
 
 
        {
-               GtkVBox* vbox = ui::VBox( FALSE, 5 );
+               auto vbox = ui::VBox( FALSE, 5 );
                gtk_container_set_border_width( GTK_CONTAINER( vbox ), 5 );
-               gtk_widget_show( GTK_WIDGET( vbox ) );
+               vbox.show();
                gtk_container_add( GTK_CONTAINER( window ), GTK_WIDGET( vbox ) );
                {
-                       GtkHBox* hbox = ui::HBox( FALSE, 5 );
-                       gtk_widget_show( GTK_WIDGET( hbox ) );
+                       auto hbox = ui::HBox( FALSE, 5 );
+                       hbox.show();
                        gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( hbox ), TRUE, TRUE, 0 );
                        {
-                               GtkVBox* vbox2 = ui::VBox( FALSE, 0 );
+                               auto vbox2 = ui::VBox( FALSE, 0 );
                                gtk_container_set_border_width( GTK_CONTAINER( vbox2 ), 0 );
-                               gtk_widget_show( GTK_WIDGET( vbox2 ) );
+                               vbox2.show();
                                gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( vbox2 ), TRUE, TRUE, 0 );
                                {
-                                       GtkFrame* frame = ui::Frame( "Details" );
-                                       gtk_widget_show( GTK_WIDGET( frame ) );
+                                       auto frame = ui::Frame( "Details" );
+                                       frame.show();
                                        gtk_box_pack_start( GTK_BOX( vbox2 ), GTK_WIDGET( frame ), TRUE, TRUE, 0 );
                                        {
-                                               GtkVBox* vbox3 = ui::VBox( FALSE, 5 );
+                                               auto vbox3 = ui::VBox( FALSE, 5 );
                                                gtk_container_set_border_width( GTK_CONTAINER( vbox3 ), 5 );
-                                               gtk_widget_show( GTK_WIDGET( vbox3 ) );
+                                               vbox3.show();
                                                gtk_container_add( GTK_CONTAINER( frame ), GTK_WIDGET( vbox3 ) );
                                                {
-                                                       GtkTable* table = ui::Table( 2, 2, FALSE );
-                                                       gtk_widget_show( GTK_WIDGET( table ) );
+                                                       auto table = ui::Table( 2, 2, FALSE );
+                                                       table.show();
                                                        gtk_box_pack_start( GTK_BOX( vbox3 ), GTK_WIDGET( table ), TRUE, TRUE, 0 );
                                                        gtk_table_set_row_spacings( table, 5 );
                                                        gtk_table_set_col_spacings( table, 5 );
                                                        {
-                                                               GtkLabel* label = GTK_LABEL( ui::Label( "Row:" ) );
-                                                               gtk_widget_show( GTK_WIDGET( label ) );
+                                                               auto label = ui::Label( "Row:" );
+                                                               label.show();
                                                                gtk_table_attach( table, GTK_WIDGET( label ), 0, 1, 0, 1,
                                                                                                  (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
                                                                                                  (GtkAttachOptions)( 0 ), 0, 0 );
                                                        }
                                                        {
-                                                               GtkLabel* label = GTK_LABEL( ui::Label( "Column:" ) );
-                                                               gtk_widget_show( GTK_WIDGET( label ) );
+                                                               auto label = ui::Label( "Column:" );
+                                                               label.show();
                                                                gtk_table_attach( table, GTK_WIDGET( label ), 1, 2, 0, 1,
                                                                                                  (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
                                                                                                  (GtkAttachOptions)( 0 ), 0, 0 );
@@ -610,7 +610,7 @@ ui::Window PatchInspector::BuildDialog(){
                                                                g_signal_connect( G_OBJECT( combo ), "changed", G_CALLBACK( OnSelchangeComboColRow ), this );
                                                                AddDialogData( *GTK_COMBO_BOX(combo), m_nRow );
 
-                                                               gtk_widget_show( GTK_WIDGET( combo ) );
+                                                               combo.show();
                                                                gtk_table_attach( table, GTK_WIDGET( combo ), 0, 1, 1, 2,
                                                                                                  (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
                                                                                                  (GtkAttachOptions)( 0 ), 0, 0 );
@@ -623,7 +623,7 @@ ui::Window PatchInspector::BuildDialog(){
                                                                g_signal_connect( G_OBJECT( combo ), "changed", G_CALLBACK( OnSelchangeComboColRow ), this );
                                                                AddDialogData( *GTK_COMBO_BOX(combo), m_nCol );
 
-                                                               gtk_widget_show( GTK_WIDGET( combo ) );
+                                                               combo.show();
                                                                gtk_table_attach( table, GTK_WIDGET( combo ), 1, 2, 1, 2,
                                                                                                  (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
                                                                                                  (GtkAttachOptions)( 0 ), 0, 0 );
@@ -631,123 +631,123 @@ ui::Window PatchInspector::BuildDialog(){
                                                                m_pColCombo = combo;
                                                        }
                                                }
-                                               GtkTable* table = ui::Table( 5, 2, FALSE );
-                                               gtk_widget_show( GTK_WIDGET( table ) );
+                                               auto table = ui::Table( 5, 2, FALSE );
+                                               table.show();
                                                gtk_box_pack_start( GTK_BOX( vbox3 ), GTK_WIDGET( table ), TRUE, TRUE, 0 );
                                                gtk_table_set_row_spacings( table, 5 );
                                                gtk_table_set_col_spacings( table, 5 );
                                                {
-                                                       GtkLabel* label = GTK_LABEL( ui::Label( "X:" ) );
-                                                       gtk_widget_show( GTK_WIDGET( label ) );
+                                                       auto label = ui::Label( "X:" );
+                                                       label.show();
                                                        gtk_table_attach( table, GTK_WIDGET( label ), 0, 1, 0, 1,
                                                                                          (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
                                                }
                                                {
-                                                       GtkLabel* label = GTK_LABEL( ui::Label( "Y:" ) );
-                                                       gtk_widget_show( GTK_WIDGET( label ) );
+                                                       auto label = ui::Label( "Y:" );
+                                                       label.show();
                                                        gtk_table_attach( table, GTK_WIDGET( label ), 0, 1, 1, 2,
                                                                                          (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
                                                }
                                                {
-                                                       GtkLabel* label = GTK_LABEL( ui::Label( "Z:" ) );
-                                                       gtk_widget_show( GTK_WIDGET( label ) );
+                                                       auto label = ui::Label( "Z:" );
+                                                       label.show();
                                                        gtk_table_attach( table, GTK_WIDGET( label ), 0, 1, 2, 3,
                                                                                          (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
                                                }
                                                {
-                                                       GtkLabel* label = GTK_LABEL( ui::Label( "S:" ) );
-                                                       gtk_widget_show( GTK_WIDGET( label ) );
+                                                       auto label = ui::Label( "S:" );
+                                                       label.show();
                                                        gtk_table_attach( table, GTK_WIDGET( label ), 0, 1, 3, 4,
                                                                                          (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
                                                }
                                                {
-                                                       GtkLabel* label = GTK_LABEL( ui::Label( "T:" ) );
-                                                       gtk_widget_show( GTK_WIDGET( label ) );
+                                                       auto label = ui::Label( "T:" );
+                                                       label.show();
                                                        gtk_table_attach( table, GTK_WIDGET( label ), 0, 1, 4, 5,
                                                                                          (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
                                                }
                                                {
-                                                       GtkEntry* entry = ui::Entry();
-                                                       gtk_widget_show( GTK_WIDGET( entry ) );
+                                                       auto entry = ui::Entry();
+                                                       entry.show();
                                                        gtk_table_attach( table, GTK_WIDGET( entry ), 1, 2, 0, 1,
                                                                                          (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
-                                                       AddDialogData( *entry, m_fX );
+                                                       AddDialogData( *GTK_ENTRY(entry), m_fX );
 
                                                        g_signal_connect( G_OBJECT( entry ), "key_press_event", G_CALLBACK( OnDialogKey ), 0 );
                                                }
                                                {
-                                                       GtkEntry* entry = ui::Entry();
-                                                       gtk_widget_show( GTK_WIDGET( entry ) );
+                                                       auto entry = ui::Entry();
+                                                       entry.show();
                                                        gtk_table_attach( table, GTK_WIDGET( entry ), 1, 2, 1, 2,
                                                                                          (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
-                                                       AddDialogData( *entry, m_fY );
+                                                       AddDialogData( *GTK_ENTRY(entry), m_fY );
 
                                                        g_signal_connect( G_OBJECT( entry ), "key_press_event", G_CALLBACK( OnDialogKey ), 0 );
                                                }
                                                {
-                                                       GtkEntry* entry = ui::Entry();
-                                                       gtk_widget_show( GTK_WIDGET( entry ) );
+                                                       auto entry = ui::Entry();
+                                                       entry.show();
                                                        gtk_table_attach( table, GTK_WIDGET( entry ), 1, 2, 2, 3,
                                                                                          (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
-                                                       AddDialogData( *entry, m_fZ );
+                                                       AddDialogData( *GTK_ENTRY(entry), m_fZ );
 
                                                        g_signal_connect( G_OBJECT( entry ), "key_press_event", G_CALLBACK( OnDialogKey ), 0 );
                                                }
                                                {
-                                                       GtkEntry* entry = ui::Entry();
-                                                       gtk_widget_show( GTK_WIDGET( entry ) );
+                                                       auto entry = ui::Entry();
+                                                       entry.show();
                                                        gtk_table_attach( table, GTK_WIDGET( entry ), 1, 2, 3, 4,
                                                                                          (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
-                                                       AddDialogData( *entry, m_fS );
+                                                       AddDialogData( *GTK_ENTRY(entry), m_fS );
 
                                                        g_signal_connect( G_OBJECT( entry ), "key_press_event", G_CALLBACK( OnDialogKey ), 0 );
                                                }
                                                {
-                                                       GtkEntry* entry = ui::Entry();
-                                                       gtk_widget_show( GTK_WIDGET( entry ) );
+                                                       auto entry = ui::Entry();
+                                                       entry.show();
                                                        gtk_table_attach( table, GTK_WIDGET( entry ), 1, 2, 4, 5,
                                                                                          (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
-                                                       AddDialogData( *entry, m_fT );
+                                                       AddDialogData( *GTK_ENTRY(entry), m_fT );
 
                                                        g_signal_connect( G_OBJECT( entry ), "key_press_event", G_CALLBACK( OnDialogKey ), 0 );
                                                }
                                        }
                                }
                                if ( g_pGameDescription->mGameType == "doom3" ) {
-                                       GtkFrame* frame = ui::Frame( "Tesselation" );
-                                       gtk_widget_show( GTK_WIDGET( frame ) );
+                                       auto frame = ui::Frame( "Tesselation" );
+                                       frame.show();
                                        gtk_box_pack_start( GTK_BOX( vbox2 ), GTK_WIDGET( frame ), TRUE, TRUE, 0 );
                                        {
-                                               GtkVBox* vbox3 = ui::VBox( FALSE, 5 );
+                                               auto vbox3 = ui::VBox( FALSE, 5 );
                                                gtk_container_set_border_width( GTK_CONTAINER( vbox3 ), 5 );
-                                               gtk_widget_show( GTK_WIDGET( vbox3 ) );
+                                               vbox3.show();
                                                gtk_container_add( GTK_CONTAINER( frame ), GTK_WIDGET( vbox3 ) );
                                                {
-                                                       GtkTable* table = ui::Table( 3, 2, FALSE );
-                                                       gtk_widget_show( GTK_WIDGET( table ) );
+                                                       auto table = ui::Table( 3, 2, FALSE );
+                                                       table.show();
                                                        gtk_box_pack_start( GTK_BOX( vbox3 ), GTK_WIDGET( table ), TRUE, TRUE, 0 );
                                                        gtk_table_set_row_spacings( table, 5 );
                                                        gtk_table_set_col_spacings( table, 5 );
                                                        {
-                                                               GtkLabel* label = GTK_LABEL( ui::Label( "Fixed" ) );
-                                                               gtk_widget_show( GTK_WIDGET( label ) );
+                                                               auto label = ui::Label( "Fixed" );
+                                                               label.show();
                                                                gtk_table_attach( table, GTK_WIDGET( label ), 0, 1, 0, 1,
                                                                                                  (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
                                                                                                  (GtkAttachOptions)( 0 ), 0, 0 );
                                                        }
                                                        {
                                                                auto check = ui::CheckButton(GTK_CHECK_BUTTON( gtk_check_button_new() ));
-                                                               gtk_widget_show( GTK_WIDGET( check ) );
+                                                               check.show();
                                                                gtk_table_attach( table, GTK_WIDGET( check ), 1, 2, 0, 1,
                                                                                                  (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
                                                                                                  (GtkAttachOptions)( 0 ), 0, 0 );
@@ -756,15 +756,15 @@ ui::Window PatchInspector::BuildDialog(){
                                                                g_object_set_data( G_OBJECT( check ), "handler", gint_to_pointer( handler_id ) );
                                                        }
                                                        {
-                                                               GtkLabel* label = GTK_LABEL( ui::Label( "Horizontal" ) );
-                                                               gtk_widget_show( GTK_WIDGET( label ) );
+                                                               auto label = ui::Label( "Horizontal" );
+                                                               label.show();
                                                                gtk_table_attach( table, GTK_WIDGET( label ), 0, 1, 1, 2,
                                                                                                  (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
                                                                                                  (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, 1, 2,
                                                                                                  (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
                                                                                                  (GtkAttachOptions)( 0 ), 0, 0 );
@@ -772,15 +772,15 @@ ui::Window PatchInspector::BuildDialog(){
                                                                m_horizontalSubdivisionsEntry.connect( entry );
                                                        }
                                                        {
-                                                               auto label = GTK_LABEL( ui::Label( "Vertical" ) );
-                                                               gtk_widget_show( GTK_WIDGET( label ) );
+                                                               auto label = ui::Label( "Vertical" );
+                                                               label.show();
                                                                gtk_table_attach( table, GTK_WIDGET( label ), 0, 1, 2, 3,
                                                                                                  (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
                                                                                                  (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, 2, 3,
                                                                                                  (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
                                                                                                  (GtkAttachOptions)( 0 ), 0, 0 );
@@ -792,63 +792,63 @@ ui::Window PatchInspector::BuildDialog(){
                                }
                        }
                        {
-                               GtkFrame* frame = ui::Frame( "Texturing" );
-                               gtk_widget_show( GTK_WIDGET( frame ) );
+                               auto frame = ui::Frame( "Texturing" );
+                               frame.show();
                                gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( frame ), TRUE, TRUE, 0 );
                                {
-                                       GtkVBox* vbox2 = ui::VBox( FALSE, 5 );
-                                       gtk_widget_show( GTK_WIDGET( vbox2 ) );
+                                       auto vbox2 = ui::VBox( FALSE, 5 );
+                                       vbox2.show();
                                        gtk_container_add( GTK_CONTAINER( frame ), GTK_WIDGET( vbox2 ) );
                                        gtk_container_set_border_width( GTK_CONTAINER( vbox2 ), 5 );
                                        {
-                                               GtkLabel* label = GTK_LABEL( ui::Label( "Name:" ) );
-                                               gtk_widget_show( GTK_WIDGET( label ) );
+                                               auto label = ui::Label( "Name:" );
+                                               label.show();
                                                gtk_box_pack_start( GTK_BOX( vbox2 ), GTK_WIDGET( label ), TRUE, TRUE, 0 );
                                                gtk_label_set_justify( label, GTK_JUSTIFY_LEFT );
                                                gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
                                        }
                                        {
-                                               GtkEntry* entry = ui::Entry();
+                                               auto entry = ui::Entry();
                                                //  gtk_editable_set_editable (GTK_ENTRY (entry), false);
-                                               gtk_widget_show( GTK_WIDGET( entry ) );
+                                               entry.show();
                                                gtk_box_pack_start( GTK_BOX( vbox2 ), GTK_WIDGET( entry ), TRUE, TRUE, 0 );
-                                               AddDialogData( *entry, m_strName );
+                                               AddDialogData( *GTK_ENTRY(entry), m_strName );
 
                                                g_signal_connect( G_OBJECT( entry ), "key_press_event", G_CALLBACK( OnDialogKey ), 0 );
                                        }
                                        {
-                                               GtkTable* table = ui::Table( 5, 4, FALSE );
-                                               gtk_widget_show( GTK_WIDGET( table ) );
+                                               auto table = ui::Table( 5, 4, FALSE );
+                                               table.show();
                                                gtk_box_pack_start( GTK_BOX( vbox2 ), GTK_WIDGET( table ), TRUE, TRUE, 0 );
                                                gtk_table_set_row_spacings( table, 5 );
                                                gtk_table_set_col_spacings( table, 5 );
                                                {
-                                                       GtkLabel* label = GTK_LABEL( ui::Label( "Horizontal Shift Step" ) );
-                                                       gtk_widget_show( GTK_WIDGET( label ) );
+                                                       auto label = ui::Label( "Horizontal Shift Step" );
+                                                       label.show();
                                                        gtk_table_attach( table, GTK_WIDGET( label ), 2, 4, 0, 1,
                                                                                          (GtkAttachOptions)( GTK_FILL|GTK_EXPAND ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
                                                        gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
                                                }
                                                {
-                                                       GtkLabel* label = GTK_LABEL( ui::Label( "Vertical Shift Step" ) );
-                                                       gtk_widget_show( GTK_WIDGET( label ) );
+                                                       auto label = ui::Label( "Vertical Shift Step" );
+                                                       label.show();
                                                        gtk_table_attach( table, GTK_WIDGET( label ), 2, 4, 1, 2,
                                                                                          (GtkAttachOptions)( GTK_FILL|GTK_EXPAND ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
                                                        gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
                                                }
                                                {
-                                                       GtkLabel* label = GTK_LABEL( ui::Label( "Horizontal Stretch Step" ) );
-                                                       gtk_widget_show( GTK_WIDGET( label ) );
+                                                       auto label = ui::Label( "Horizontal Stretch Step" );
+                                                       label.show();
                                                        gtk_table_attach( table, GTK_WIDGET( label ), 2, 3, 2, 3,
                                                                                          (GtkAttachOptions)( GTK_FILL|GTK_EXPAND ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
                                                        gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
                                                }
                                                {
-                                                       GtkButton* button = ui::Button( "Flip" );
-                                                       gtk_widget_show( GTK_WIDGET( button ) );
+                                                       auto button = ui::Button( "Flip" );
+                                                       button.show();
                                                        gtk_table_attach( table, GTK_WIDGET( button ), 3, 4, 2, 3,
                                                                                          (GtkAttachOptions)( GTK_FILL ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
@@ -856,16 +856,16 @@ ui::Window PatchInspector::BuildDialog(){
                                                        gtk_widget_set_size_request( GTK_WIDGET( button ), 60, -1 );
                                                }
                                                {
-                                                       GtkLabel* label = GTK_LABEL( ui::Label( "Vertical Stretch Step" ) );
-                                                       gtk_widget_show( GTK_WIDGET( label ) );
+                                                       auto label = ui::Label( "Vertical Stretch Step" );
+                                                       label.show();
                                                        gtk_table_attach( table, GTK_WIDGET( label ), 2, 3, 3, 4,
                                                                                          (GtkAttachOptions)( GTK_FILL|GTK_EXPAND ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
                                                        gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
                                                }
                                                {
-                                                       GtkButton* button = ui::Button( "Flip" );
-                                                       gtk_widget_show( GTK_WIDGET( button ) );
+                                                       auto button = ui::Button( "Flip" );
+                                                       button.show();
                                                        gtk_table_attach( table, GTK_WIDGET( button ), 3, 4, 3, 4,
                                                                                          (GtkAttachOptions)( GTK_FILL ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
@@ -873,8 +873,8 @@ ui::Window PatchInspector::BuildDialog(){
                                                        gtk_widget_set_size_request( GTK_WIDGET( button ), 60, -1 );
                                                }
                                                {
-                                                       GtkLabel* label = GTK_LABEL( ui::Label( "Rotate Step" ) );
-                                                       gtk_widget_show( GTK_WIDGET( label ) );
+                                                       auto label = ui::Label( "Rotate Step" );
+                                                       label.show();
                                                        gtk_table_attach( table, GTK_WIDGET( label ), 2, 4, 4, 5,
                                                                                          (GtkAttachOptions)( GTK_FILL|GTK_EXPAND ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
@@ -882,7 +882,7 @@ ui::Window PatchInspector::BuildDialog(){
                                                }
                                                {
                                                        auto entry = ui::Entry();
-                                                       gtk_widget_show( GTK_WIDGET( entry ) );
+                                                       entry.show();
                                                        gtk_table_attach( table, GTK_WIDGET( entry ), 0, 1, 0, 1,
                                                                                          (GtkAttachOptions)( GTK_FILL ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
@@ -897,7 +897,7 @@ ui::Window PatchInspector::BuildDialog(){
                                                        g_object_set_data( G_OBJECT( window ), "hshift_adj", (gpointer) adj );
 
                                                        auto spin = ui::SpinButton( adj, 1, 0 );
-                                                       gtk_widget_show( GTK_WIDGET( spin ) );
+                                                       spin.show();
                                                        gtk_table_attach( table, GTK_WIDGET( spin ), 1, 2, 0, 1,
                                                                                          (GtkAttachOptions)( 0 ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
@@ -906,7 +906,7 @@ ui::Window PatchInspector::BuildDialog(){
                                                }
                                                {
                                                        auto entry = ui::Entry();
-                                                       gtk_widget_show( GTK_WIDGET( entry ) );
+                                                       entry.show();
                                                        gtk_table_attach( table, GTK_WIDGET( entry ), 0, 1, 1, 2,
                                                                                          (GtkAttachOptions)( GTK_FILL ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
@@ -918,7 +918,7 @@ ui::Window PatchInspector::BuildDialog(){
                                                        g_object_set_data( G_OBJECT( window ), "vshift_adj", (gpointer) adj );
 
                                                        auto spin = ui::SpinButton( adj, 1, 0 );
-                                                       gtk_widget_show( GTK_WIDGET( spin ) );
+                                                       spin.show();
                                                        gtk_table_attach( table, GTK_WIDGET( spin ), 1, 2, 1, 2,
                                                                                          (GtkAttachOptions)( 0 ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
@@ -927,7 +927,7 @@ ui::Window PatchInspector::BuildDialog(){
                                                }
                                                {
                                                        auto entry = ui::Entry();
-                                                       gtk_widget_show( GTK_WIDGET( entry ) );
+                                                       entry.show();
                                                        gtk_table_attach( table, GTK_WIDGET( entry ), 0, 1, 2, 3,
                                                                                          (GtkAttachOptions)( GTK_FILL ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
@@ -939,7 +939,7 @@ ui::Window PatchInspector::BuildDialog(){
                                                        g_object_set_data( G_OBJECT( window ), "hscale_adj", (gpointer) adj );
 
                                                        auto spin = ui::SpinButton( adj, 1, 0 );
-                                                       gtk_widget_show( GTK_WIDGET( spin ) );
+                                                       spin.show();
                                                        gtk_table_attach( table, GTK_WIDGET( spin ), 1, 2, 2, 3,
                                                                                          (GtkAttachOptions)( 0 ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
@@ -948,7 +948,7 @@ ui::Window PatchInspector::BuildDialog(){
                                                }
                                                {
                                                        auto entry = ui::Entry();
-                                                       gtk_widget_show( GTK_WIDGET( entry ) );
+                                                       entry.show();
                                                        gtk_table_attach( table, GTK_WIDGET( entry ), 0, 1, 3, 4,
                                                                                          (GtkAttachOptions)( GTK_FILL ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
@@ -960,7 +960,7 @@ ui::Window PatchInspector::BuildDialog(){
                                                        g_object_set_data( G_OBJECT( window ), "vscale_adj", (gpointer) adj );
 
                                                        auto spin = ui::SpinButton( adj, 1, 0 );
-                                                       gtk_widget_show( GTK_WIDGET( spin ) );
+                                                       spin.show();
                                                        gtk_table_attach( table, GTK_WIDGET( spin ), 1, 2, 3, 4,
                                                                                          (GtkAttachOptions)( 0 ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
@@ -969,7 +969,7 @@ ui::Window PatchInspector::BuildDialog(){
                                                }
                                                {
                                                        auto entry = ui::Entry();
-                                                       gtk_widget_show( GTK_WIDGET( entry ) );
+                                                       entry.show();
                                                        gtk_table_attach( table, GTK_WIDGET( entry ), 0, 1, 4, 5,
                                                                                          (GtkAttachOptions)( GTK_FILL ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
@@ -981,7 +981,7 @@ ui::Window PatchInspector::BuildDialog(){
                                                        g_object_set_data( G_OBJECT( window ), "rotate_adj", (gpointer) adj );
 
                                                        auto spin = ui::SpinButton( adj, 1, 0 );
-                                                       gtk_widget_show( GTK_WIDGET( spin ) );
+                                                       spin.show();
                                                        gtk_table_attach( table, GTK_WIDGET( spin ), 1, 2, 4, 5,
                                                                                          (GtkAttachOptions)( 0 ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
@@ -989,40 +989,40 @@ ui::Window PatchInspector::BuildDialog(){
                                                        gtk_widget_set_can_focus( spin, false );
                                                }
                                        }
-                                       GtkHBox* hbox2 = ui::HBox( TRUE, 5 );
-                                       gtk_widget_show( GTK_WIDGET( hbox2 ) );
+                                       auto hbox2 = ui::HBox( TRUE, 5 );
+                                       hbox2.show();
                                        gtk_box_pack_start( GTK_BOX( vbox2 ), GTK_WIDGET( hbox2 ), TRUE, FALSE, 0 );
                                        {
-                                               GtkButton* button = ui::Button( "Auto Cap" );
-                                               gtk_widget_show( GTK_WIDGET( button ) );
+                                               auto button = ui::Button( "Auto Cap" );
+                                               button.show();
                                                gtk_box_pack_end( GTK_BOX( hbox2 ), GTK_WIDGET( button ), TRUE, FALSE, 0 );
                                                g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnBtnPatchAutoCap ), 0 );
                                                gtk_widget_set_size_request( GTK_WIDGET( button ), 60, -1 );
                                        }
                                        {
-                                               GtkButton* button = ui::Button( "CAP" );
-                                               gtk_widget_show( GTK_WIDGET( button ) );
+                                               auto button = ui::Button( "CAP" );
+                                               button.show();
                                                gtk_box_pack_end( GTK_BOX( hbox2 ), GTK_WIDGET( button ), TRUE, FALSE, 0 );
                                                g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnBtnPatchdetails ), 0 );
                                                gtk_widget_set_size_request( GTK_WIDGET( button ), 60, -1 );
                                        }
                                        {
-                                               GtkButton* button = ui::Button( "Set..." );
-                                               gtk_widget_show( GTK_WIDGET( button ) );
+                                               auto button = ui::Button( "Set..." );
+                                               button.show();
                                                gtk_box_pack_end( GTK_BOX( hbox2 ), GTK_WIDGET( button ), TRUE, FALSE, 0 );
                                                g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnBtnPatchreset ), 0 );
                                                gtk_widget_set_size_request( GTK_WIDGET( button ), 60, -1 );
                                        }
                                        {
-                                               GtkButton* button = ui::Button( "Natural" );
-                                               gtk_widget_show( GTK_WIDGET( button ) );
+                                               auto button = ui::Button( "Natural" );
+                                               button.show();
                                                gtk_box_pack_end( GTK_BOX( hbox2 ), GTK_WIDGET( button ), TRUE, FALSE, 0 );
                                                g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnBtnPatchnatural ), 0 );
                                                gtk_widget_set_size_request( GTK_WIDGET( button ), 60, -1 );
                                        }
                                        {
-                                               GtkButton* button = ui::Button( "Fit" );
-                                               gtk_widget_show( GTK_WIDGET( button ) );
+                                               auto button = ui::Button( "Fit" );
+                                               button.show();
                                                gtk_box_pack_end( GTK_BOX( hbox2 ), GTK_WIDGET( button ), TRUE, FALSE, 0 );
                                                g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnBtnPatchfit ), 0 );
                                                gtk_widget_set_size_request( GTK_WIDGET( button ), 60, -1 );
index 6baad5ecd695be70682ca9113fc019ce43ae2089..572e8e9b533eeebc4f2bbf5f1cf6366f673de51d 100644 (file)
@@ -858,16 +858,16 @@ void DoNewPatchDlg( EPatchPrefab prefab, int minrows, int mincols, int defrows,
                        GtkTable* table = create_dialog_table( 2, 2, 4, 4 );
                        gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( table ), TRUE, TRUE, 0 );
                        {
-                               GtkLabel* label = GTK_LABEL( ui::Label( "Width:" ) );
-                               gtk_widget_show( GTK_WIDGET( label ) );
+                               auto label = ui::Label( "Width:" );
+                               label.show();
                                gtk_table_attach( table, GTK_WIDGET( label ), 0, 1, 0, 1,
                                                                  (GtkAttachOptions) ( GTK_FILL ),
                                                                  (GtkAttachOptions) ( 0 ), 0, 0 );
                                gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
                        }
                        {
-                               GtkLabel* label = GTK_LABEL( ui::Label( "Height:" ) );
-                               gtk_widget_show( GTK_WIDGET( label ) );
+                               auto label = ui::Label( "Height:" );
+                               label.show();
                                gtk_table_attach( table, GTK_WIDGET( label ), 0, 1, 1, 2,
                                                                  (GtkAttachOptions) ( GTK_FILL ),
                                                                  (GtkAttachOptions) ( 0 ), 0, 0 );
@@ -893,7 +893,7 @@ void DoNewPatchDlg( EPatchPrefab prefab, int minrows, int mincols, int defrows,
                                D_ITEM( 29 );
                                D_ITEM( 31 ); // MAX_PATCH_SIZE is 32, so we should be able to do 31...
 #undef D_ITEM
-                               gtk_widget_show( GTK_WIDGET( combo ) );
+                               combo.show();
                                gtk_table_attach( table, GTK_WIDGET( combo ), 1, 2, 0, 1,
                                                                  (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                                                  (GtkAttachOptions) ( 0 ), 0, 0 );
@@ -919,7 +919,7 @@ void DoNewPatchDlg( EPatchPrefab prefab, int minrows, int mincols, int defrows,
                                D_ITEM( 29 );
                                D_ITEM( 31 ); // MAX_PATCH_SIZE is 32, so we should be able to do 31...
 #undef D_ITEM
-                               gtk_widget_show( GTK_WIDGET( combo ) );
+                               combo.show();
                                gtk_table_attach( table, GTK_WIDGET( combo ), 1, 2, 1, 2,
                                                                  (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                                                  (GtkAttachOptions) ( 0 ), 0, 0 );
@@ -988,43 +988,43 @@ EMessageBoxReturn DoCapDlg( ECapDialog* type ){
                        gtk_container_add( GTK_CONTAINER( hbox ), GTK_WIDGET( radio_vbox ) );
 
                        {
-                               GtkTable* table = ui::Table( 5, 2, FALSE );
-                               gtk_widget_show( GTK_WIDGET( table ) );
+                               auto table = ui::Table( 5, 2, FALSE );
+                               table.show();
                                gtk_box_pack_start( GTK_BOX( radio_vbox ), GTK_WIDGET( table ), TRUE, TRUE, 0 );
                                gtk_table_set_row_spacings( table, 5 );
                                gtk_table_set_col_spacings( table, 5 );
 
                                {
-                                       GtkImage* image = new_local_image( "cap_bevel.png" );
-                                       gtk_widget_show( GTK_WIDGET( image ) );
+                                       auto image = new_local_image( "cap_bevel.png" );
+                                       image.show();
                                        gtk_table_attach( table, GTK_WIDGET( image ), 0, 1, 0, 1,
                                                                          (GtkAttachOptions) ( GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
                                }
                                {
-                                       GtkImage* image = new_local_image( "cap_endcap.png" );
-                                       gtk_widget_show( GTK_WIDGET( image ) );
+                                       auto image = new_local_image( "cap_endcap.png" );
+                                       image.show();
                                        gtk_table_attach( table, GTK_WIDGET( image ), 0, 1, 1, 2,
                                                                          (GtkAttachOptions) ( GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
                                }
                                {
-                                       GtkImage* image = new_local_image( "cap_ibevel.png" );
-                                       gtk_widget_show( GTK_WIDGET( image ) );
+                                       auto image = new_local_image( "cap_ibevel.png" );
+                                       image.show();
                                        gtk_table_attach( table, GTK_WIDGET( image ), 0, 1, 2, 3,
                                                                          (GtkAttachOptions) ( GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
                                }
                                {
-                                       GtkImage* image = new_local_image( "cap_iendcap.png" );
-                                       gtk_widget_show( GTK_WIDGET( image ) );
+                                       auto image = new_local_image( "cap_iendcap.png" );
+                                       image.show();
                                        gtk_table_attach( table, GTK_WIDGET( image ), 0, 1, 3, 4,
                                                                          (GtkAttachOptions) ( GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
                                }
                                {
-                                       GtkImage* image = new_local_image( "cap_cylinder.png" );
-                                       gtk_widget_show( GTK_WIDGET( image ) );
+                                       auto image = new_local_image( "cap_cylinder.png" );
+                                       image.show();
                                        gtk_table_attach( table, GTK_WIDGET( image ), 0, 1, 4, 5,
                                                                          (GtkAttachOptions) ( GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
@@ -1033,7 +1033,7 @@ EMessageBoxReturn DoCapDlg( ECapDialog* type ){
                                GSList* group = 0;
                                {
                                        ui::Widget button = ui::Widget(gtk_radio_button_new_with_label( group, "Bevel" ));
-                                       gtk_widget_show( button );
+                                       button.show();
                                        gtk_table_attach( table, button, 1, 2, 0, 1,
                                                                          (GtkAttachOptions) ( GTK_FILL | GTK_EXPAND ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
@@ -1043,7 +1043,7 @@ EMessageBoxReturn DoCapDlg( ECapDialog* type ){
                                }
                                {
                                        ui::Widget button = ui::Widget(gtk_radio_button_new_with_label( group, "Endcap" ));
-                                       gtk_widget_show( button );
+                                       button.show();
                                        gtk_table_attach( table, button, 1, 2, 1, 2,
                                                                          (GtkAttachOptions) ( GTK_FILL | GTK_EXPAND ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
@@ -1053,7 +1053,7 @@ EMessageBoxReturn DoCapDlg( ECapDialog* type ){
                                }
                                {
                                        ui::Widget button = ui::Widget(gtk_radio_button_new_with_label( group, "Inverted Bevel" ));
-                                       gtk_widget_show( button );
+                                       button.show();
                                        gtk_table_attach( table, button, 1, 2, 2, 3,
                                                                          (GtkAttachOptions) ( GTK_FILL | GTK_EXPAND ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
@@ -1063,7 +1063,7 @@ EMessageBoxReturn DoCapDlg( ECapDialog* type ){
                                }
                                {
                                        ui::Widget button = ui::Widget(gtk_radio_button_new_with_label( group, "Inverted Endcap" ));
-                                       gtk_widget_show( button );
+                                       button.show();
                                        gtk_table_attach( table, button, 1, 2, 3, 4,
                                                                          (GtkAttachOptions) ( GTK_FILL | GTK_EXPAND ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
@@ -1073,7 +1073,7 @@ EMessageBoxReturn DoCapDlg( ECapDialog* type ){
                                }
                                {
                                        ui::Widget button = ui::Widget(gtk_radio_button_new_with_label( group, "Cylinder" ));
-                                       gtk_widget_show( button );
+                                       button.show();
                                        gtk_table_attach( table, button, 1, 2, 4, 5,
                                                                          (GtkAttachOptions) ( GTK_FILL | GTK_EXPAND ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
index b72660b18a2a904b2dbf9f7309dba9c7fbcd373d..d3c1519d4d6cc1962f0954e7e767e7d930379f44 100644 (file)
@@ -47,7 +47,7 @@ void PlugInMenu_Add( GtkMenu* plugin_menu, IPlugIn* pPlugIn ){
        std::stack<ui::Menu> menuStack;
 
        parent = ui::MenuItem( pPlugIn->getMenuName() );
-       gtk_widget_show( parent );
+       parent.show();
        gtk_container_add( GTK_CONTAINER( plugin_menu ), parent );
 
        std::size_t nCount = pPlugIn->getCommandCount();
@@ -75,7 +75,7 @@ void PlugInMenu_Add( GtkMenu* plugin_menu, IPlugIn* pPlugIn ){
                                        }
 
                                        item = ui::MenuItem( menuText );
-                                       gtk_widget_show( item );
+                                       item.show();
                                        gtk_container_add( GTK_CONTAINER( menu ), item );
 
                                        subMenu = ui::Menu();
@@ -101,7 +101,7 @@ void PlugInMenu_Add( GtkMenu* plugin_menu, IPlugIn* pPlugIn ){
                                        g_object_set_data( G_OBJECT( item ),"command", const_cast<gpointer>( static_cast<const void*>( menuCommand ) ) );
                                        g_signal_connect( G_OBJECT( item ), "activate", G_CALLBACK( plugin_activated ), gint_to_pointer( m_nNextPlugInID ) );
                                }
-                               gtk_widget_show( item );
+                               item.show();
                                gtk_container_add( GTK_CONTAINER( menu ), item );
                                pPlugIn->addMenuID( m_nNextPlugInID++ );
                        }
index 3a79f3e13a61a20a4dfc6c6fa895a1f8226fbc59..6486e1bd176725c99f6e235b4bf466a97933d61e 100644 (file)
@@ -56,8 +56,8 @@ ui::Image new_plugin_image( const char* filename ){
 
 void toolbar_insert( GtkToolbar *toolbar, const char* icon, const char* text, const char* tooltip, IToolbarButton::EType type, GCallback handler, gpointer data ){
        if (type == IToolbarButton::eSpace) {
-               auto it = gtk_separator_tool_item_new();
-               gtk_widget_show(GTK_WIDGET(it));
+               auto it = ui::Widget(GTK_WIDGET(gtk_separator_tool_item_new()));
+               it.show();
                gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(it));
                return;
        }
index 2fa1415bca6ea7a39bdc69397b38bac68153e4b9..15d216a6cfa844f9c5220554fb5e6d77b04377c9 100644 (file)
@@ -639,14 +639,14 @@ GtkTreeIter PreferenceTree_appendPage( GtkTreeStore* store, GtkTreeIter* parent,
 
 ui::Widget PreferencePages_addPage( ui::Widget notebook, const char* name ){
        ui::Widget preflabel = ui::Label( name );
-       gtk_widget_show( preflabel );
+       preflabel.show();
 
        ui::Widget pageframe = ui::Frame( name );
        gtk_container_set_border_width( GTK_CONTAINER( pageframe ), 4 );
-       gtk_widget_show( pageframe );
+       pageframe.show();
 
        ui::Widget vbox = ui::VBox( FALSE, 4 );
-       gtk_widget_show( vbox );
+       vbox.show();
        gtk_container_set_border_width( GTK_CONTAINER( vbox ), 4 );
        gtk_container_add( GTK_CONTAINER( pageframe ), vbox );
 
@@ -686,11 +686,11 @@ ui::Window PrefsDlg::BuildDialog(){
                ui::Widget mainvbox = ui::VBox( FALSE, 5 );
                gtk_container_add( GTK_CONTAINER( dialog ), mainvbox );
                gtk_container_set_border_width( GTK_CONTAINER( mainvbox ), 5 );
-               gtk_widget_show( mainvbox );
+               mainvbox.show();
 
                {
                        ui::Widget hbox = ui::HBox( FALSE, 5 );
-                       gtk_widget_show( hbox );
+                       hbox.show();
                        gtk_box_pack_end( GTK_BOX( mainvbox ), hbox, FALSE, TRUE, 0 );
 
                        {
@@ -710,13 +710,13 @@ ui::Window PrefsDlg::BuildDialog(){
                {
                        ui::Widget hbox = ui::HBox( FALSE, 5 );
                        gtk_box_pack_start( GTK_BOX( mainvbox ), hbox, TRUE, TRUE, 0 );
-                       gtk_widget_show( hbox );
+                       hbox.show();
 
                        {
                                ui::Widget sc_win = ui::ScrolledWindow();
                                gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( sc_win ), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC );
                                gtk_box_pack_start( GTK_BOX( hbox ), sc_win, FALSE, FALSE, 0 );
-                               gtk_widget_show( sc_win );
+                               sc_win.show();
                                gtk_scrolled_window_set_shadow_type( GTK_SCROLLED_WINDOW( sc_win ), GTK_SHADOW_IN );
 
                                // prefs pages notebook
@@ -724,7 +724,7 @@ ui::Window PrefsDlg::BuildDialog(){
                                // hide the notebook tabs since its not supposed to look like a notebook
                                gtk_notebook_set_show_tabs( GTK_NOTEBOOK( m_notebook ), FALSE );
                                gtk_box_pack_start( GTK_BOX( hbox ), m_notebook, TRUE, TRUE, 0 );
-                               gtk_widget_show( m_notebook );
+                               m_notebook.show();
 
 
                                {
@@ -744,7 +744,7 @@ ui::Window PrefsDlg::BuildDialog(){
                                                g_signal_connect( G_OBJECT( selection ), "changed", G_CALLBACK( treeSelection ), this );
                                        }
 
-                                       gtk_widget_show( view );
+                                       view.show();
 
                                        gtk_container_add( GTK_CONTAINER( sc_win ), view );
 
index 5c2560b574ff2cd0bca2d6a84d5c0a70d7c3bef1..d2cfed61039fea935fe7dac8458dc561521224dd 100644 (file)
@@ -921,29 +921,29 @@ void DoRotateDlg(){
                                gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( table ), TRUE, TRUE, 0 );
                                {
                                        ui::Widget label = ui::Label( "  X  " );
-                                       gtk_widget_show( label );
+                                       label.show();
                                        gtk_table_attach( table, label, 0, 1, 0, 1,
                                                                          (GtkAttachOptions) ( 0 ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
                                }
                                {
                                        ui::Widget label = ui::Label( "  Y  " );
-                                       gtk_widget_show( label );
+                                       label.show();
                                        gtk_table_attach( table, label, 0, 1, 1, 2,
                                                                          (GtkAttachOptions) ( 0 ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
                                }
                                {
                                        ui::Widget label = ui::Label( "  Z  " );
-                                       gtk_widget_show( label );
+                                       label.show();
                                        gtk_table_attach( table, label, 0, 1, 2, 3,
                                                                          (GtkAttachOptions) ( 0 ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
                                }
                                {
                                        auto adj = ui::Adjustment( 0, -359, 359, 1, 10, 0 );
-                                       GtkSpinButton* spin = ui::SpinButton( adj, 1, 0 );
-                                       gtk_widget_show( GTK_WIDGET( spin ) );
+                                       auto spin = ui::SpinButton( adj, 1, 0 );
+                                       spin.show();
                                        gtk_table_attach( table, GTK_WIDGET( spin ), 1, 2, 0, 1,
                                                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
@@ -956,8 +956,8 @@ void DoRotateDlg(){
                                }
                                {
                                        auto adj = ui::Adjustment( 0, -359, 359, 1, 10, 0 );
-                                       GtkSpinButton* spin = ui::SpinButton( adj, 1, 0 );
-                                       gtk_widget_show( GTK_WIDGET( spin ) );
+                                       auto spin = ui::SpinButton( adj, 1, 0 );
+                                       spin.show();
                                        gtk_table_attach( table, GTK_WIDGET( spin ), 1, 2, 1, 2,
                                                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
@@ -968,8 +968,8 @@ void DoRotateDlg(){
                                }
                                {
                                        auto adj = ui::Adjustment( 0, -359, 359, 1, 10, 0 );
-                                       GtkSpinButton* spin = ui::SpinButton( adj, 1, 0 );
-                                       gtk_widget_show( GTK_WIDGET( spin ) );
+                                       auto spin = ui::SpinButton( adj, 1, 0 );
+                                       spin.show();
                                        gtk_table_attach( table, GTK_WIDGET( spin ), 1, 2, 2, 3,
                                                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
@@ -1001,7 +1001,7 @@ void DoRotateDlg(){
                }
        }
 
-       gtk_widget_show( GTK_WIDGET( g_rotate_dialog.window ) );
+       g_rotate_dialog.window.show();
 }
 
 
@@ -1074,21 +1074,21 @@ void DoScaleDlg(){
                                gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( table ), TRUE, TRUE, 0 );
                                {
                                        ui::Widget label = ui::Label( "  X  " );
-                                       gtk_widget_show( label );
+                                       label.show();
                                        gtk_table_attach( table, label, 0, 1, 0, 1,
                                                                          (GtkAttachOptions) ( 0 ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
                                }
                                {
                                        ui::Widget label = ui::Label( "  Y  " );
-                                       gtk_widget_show( label );
+                                       label.show();
                                        gtk_table_attach( table, label, 0, 1, 1, 2,
                                                                          (GtkAttachOptions) ( 0 ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
                                }
                                {
                                        ui::Widget label = ui::Label( "  Z  " );
-                                       gtk_widget_show( label );
+                                       label.show();
                                        gtk_table_attach( table, label, 0, 1, 2, 3,
                                                                          (GtkAttachOptions) ( 0 ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
@@ -1096,7 +1096,7 @@ void DoScaleDlg(){
                                {
                                        ui::Widget entry = ui::Entry();
                                        gtk_entry_set_text( GTK_ENTRY( entry ), "1.0" );
-                                       gtk_widget_show( entry );
+                                       entry.show();
                                        gtk_table_attach( table, entry, 1, 2, 0, 1,
                                                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
@@ -1106,7 +1106,7 @@ void DoScaleDlg(){
                                {
                                        ui::Widget entry = ui::Entry();
                                        gtk_entry_set_text( GTK_ENTRY( entry ), "1.0" );
-                                       gtk_widget_show( entry );
+                                       entry.show();
                                        gtk_table_attach( table, entry, 1, 2, 1, 2,
                                                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
@@ -1116,7 +1116,7 @@ void DoScaleDlg(){
                                {
                                        ui::Widget entry = ui::Entry();
                                        gtk_entry_set_text( GTK_ENTRY( entry ), "1.0" );
-                                       gtk_widget_show( entry );
+                                       entry.show();
                                        gtk_table_attach( table, entry, 1, 2, 2, 3,
                                                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
@@ -1146,5 +1146,5 @@ void DoScaleDlg(){
                }
        }
 
-       gtk_widget_show( GTK_WIDGET( g_scale_dialog.window ) );
+       g_scale_dialog.window.show();
 }
index 6b0961357cc0171727ba51d4464ebab2ec1a7950..dcc5ab5baf4a91ff5082fd4b5f89598c2220510e 100644 (file)
@@ -592,23 +592,23 @@ ui::Window SurfaceInspector::BuildDialog(){
        {
                // replaced by only the vbox:
                ui::Widget vbox = ui::VBox( FALSE, 5 );
-               gtk_widget_show( vbox );
+               vbox.show();
                gtk_container_add( GTK_CONTAINER( window ), GTK_WIDGET( vbox ) );
                gtk_container_set_border_width( GTK_CONTAINER( vbox ), 5 );
 
                {
                        ui::Widget hbox2 = ui::HBox( FALSE, 5 );
-                       gtk_widget_show( hbox2 );
+                       hbox2.show();
                        gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( hbox2 ), FALSE, FALSE, 0 );
 
                        {
                                ui::Widget label = ui::Label( "Texture" );
-                               gtk_widget_show( label );
+                               label.show();
                                gtk_box_pack_start( GTK_BOX( hbox2 ), label, FALSE, TRUE, 0 );
                        }
                        {
                                auto entry = ui::Entry();
-                               gtk_widget_show( GTK_WIDGET( entry ) );
+                               entry.show();
                                gtk_box_pack_start( GTK_BOX( hbox2 ), GTK_WIDGET( entry ), TRUE, TRUE, 0 );
                                m_texture = entry;
                                m_textureEntry.connect( entry );
@@ -619,7 +619,7 @@ ui::Window SurfaceInspector::BuildDialog(){
 
                {
                        ui::Widget table = ui::Table( 6, 4, FALSE );
-                       gtk_widget_show( table );
+                       table.show();
                        gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( table ), FALSE, FALSE, 0 );
                        gtk_table_set_row_spacings( GTK_TABLE( table ), 5 );
                        gtk_table_set_col_spacings( GTK_TABLE( table ), 5 );
@@ -661,7 +661,7 @@ ui::Window SurfaceInspector::BuildDialog(){
                        }
                        {
                                ui::Widget label = ui::Label( "Vertical shift" );
-                               gtk_widget_show( label );
+                               label.show();
                                gtk_misc_set_alignment( GTK_MISC( label ), 0, 0 );
                                gtk_table_attach( GTK_TABLE( table ), label, 0, 1, 1, 2,
                                                                  (GtkAttachOptions) ( GTK_FILL ),
@@ -671,7 +671,7 @@ ui::Window SurfaceInspector::BuildDialog(){
                                auto spin = ui::SpinButton( ui::Adjustment( 0, -8192, 8192, 2, 8, 0 ), 0, 2 );
                                m_vshiftIncrement.m_spin = spin;
                                m_vshiftSpinner.connect( spin );
-                               gtk_widget_show( GTK_WIDGET( spin ) );
+                               spin.show();
                                gtk_table_attach( GTK_TABLE( table ), GTK_WIDGET( spin ), 1, 2, 1, 2,
                                                                  (GtkAttachOptions) ( GTK_FILL ),
                                                                  (GtkAttachOptions) ( 0 ), 0, 0 );
@@ -679,7 +679,7 @@ ui::Window SurfaceInspector::BuildDialog(){
                        }
                        {
                                ui::Widget label = ui::Label( "Step" );
-                               gtk_widget_show( label );
+                               label.show();
                                gtk_misc_set_alignment( GTK_MISC( label ), 0, 0 );
                                gtk_table_attach( GTK_TABLE( table ), label, 2, 3, 1, 2,
                                                                  (GtkAttachOptions) ( GTK_FILL ),
@@ -687,7 +687,7 @@ ui::Window SurfaceInspector::BuildDialog(){
                        }
                        {
                                auto entry = ui::Entry();
-                               gtk_widget_show( GTK_WIDGET( entry ) );
+                               entry.show();
                                gtk_table_attach( GTK_TABLE( table ), GTK_WIDGET( entry ), 3, 4, 1, 2,
                                                                  (GtkAttachOptions) ( GTK_FILL ),
                                                                  (GtkAttachOptions) ( 0 ), 0, 0 );
@@ -697,7 +697,7 @@ ui::Window SurfaceInspector::BuildDialog(){
                        }
                        {
                                ui::Widget label = ui::Label( "Horizontal stretch" );
-                               gtk_widget_show( label );
+                               label.show();
                                gtk_misc_set_alignment( GTK_MISC( label ), 0, 0 );
                                gtk_table_attach( GTK_TABLE( table ), label, 0, 1, 2, 3,
                                                                  (GtkAttachOptions) ( GTK_FILL ),
@@ -707,7 +707,7 @@ ui::Window SurfaceInspector::BuildDialog(){
                                auto spin = ui::SpinButton( ui::Adjustment( 0, -8192, 8192, 2, 8, 0 ), 0, 5 );
                                m_hscaleIncrement.m_spin = spin;
                                m_hscaleSpinner.connect( spin );
-                               gtk_widget_show( GTK_WIDGET( spin ) );
+                               spin.show();
                                gtk_table_attach( GTK_TABLE( table ), GTK_WIDGET( spin ), 1, 2, 2, 3,
                                                                  (GtkAttachOptions) ( GTK_FILL ),
                                                                  (GtkAttachOptions) ( 0 ), 0, 0 );
@@ -715,7 +715,7 @@ ui::Window SurfaceInspector::BuildDialog(){
                        }
                        {
                                ui::Widget label = ui::Label( "Step" );
-                               gtk_widget_show( label );
+                               label.show();
                                gtk_misc_set_alignment( GTK_MISC( label ), 0, 0 );
                                gtk_table_attach( GTK_TABLE( table ), label, 2, 3, 2, 3,
                                                                  (GtkAttachOptions) ( GTK_FILL ),
@@ -723,7 +723,7 @@ ui::Window SurfaceInspector::BuildDialog(){
                        }
                        {
                                auto entry = ui::Entry();
-                               gtk_widget_show( GTK_WIDGET( entry ) );
+                               entry.show();
                                gtk_table_attach( GTK_TABLE( table ), GTK_WIDGET( entry ), 3, 4, 2, 3,
                                                                  (GtkAttachOptions) ( GTK_FILL ),
                                                                  (GtkAttachOptions) ( 0 ), 2, 3 );
@@ -733,7 +733,7 @@ ui::Window SurfaceInspector::BuildDialog(){
                        }
                        {
                                ui::Widget label = ui::Label( "Vertical stretch" );
-                               gtk_widget_show( label );
+                               label.show();
                                gtk_misc_set_alignment( GTK_MISC( label ), 0, 0 );
                                gtk_table_attach( GTK_TABLE( table ), label, 0, 1, 3, 4,
                                                                  (GtkAttachOptions) ( GTK_FILL ),
@@ -743,7 +743,7 @@ ui::Window SurfaceInspector::BuildDialog(){
                                auto spin = ui::SpinButton( ui::Adjustment( 0, -8192, 8192, 2, 8, 0 ), 0, 5 );
                                m_vscaleIncrement.m_spin = spin;
                                m_vscaleSpinner.connect( spin );
-                               gtk_widget_show( GTK_WIDGET( spin ) );
+                               spin.show();
                                gtk_table_attach( GTK_TABLE( table ), GTK_WIDGET( spin ), 1, 2, 3, 4,
                                                                  (GtkAttachOptions) ( GTK_FILL ),
                                                                  (GtkAttachOptions) ( 0 ), 0, 0 );
@@ -751,7 +751,7 @@ ui::Window SurfaceInspector::BuildDialog(){
                        }
                        {
                                ui::Widget label = ui::Label( "Step" );
-                               gtk_widget_show( label );
+                               label.show();
                                gtk_misc_set_alignment( GTK_MISC( label ), 0, 0 );
                                gtk_table_attach( GTK_TABLE( table ), label, 2, 3, 3, 4,
                                                                  (GtkAttachOptions) ( GTK_FILL ),
@@ -759,7 +759,7 @@ ui::Window SurfaceInspector::BuildDialog(){
                        }
                        {
                                auto entry = ui::Entry();
-                               gtk_widget_show( GTK_WIDGET( entry ) );
+                               entry.show();
                                gtk_table_attach( GTK_TABLE( table ), GTK_WIDGET( entry ), 3, 4, 3, 4,
                                                                  (GtkAttachOptions) ( GTK_FILL ),
                                                                  (GtkAttachOptions) ( 0 ), 0, 0 );
@@ -769,7 +769,7 @@ ui::Window SurfaceInspector::BuildDialog(){
                        }
                        {
                                ui::Widget label = ui::Label( "Rotate" );
-                               gtk_widget_show( label );
+                               label.show();
                                gtk_misc_set_alignment( GTK_MISC( label ), 0, 0 );
                                gtk_table_attach( GTK_TABLE( table ), label, 0, 1, 4, 5,
                                                                  (GtkAttachOptions) ( GTK_FILL ),
@@ -779,7 +779,7 @@ ui::Window SurfaceInspector::BuildDialog(){
                                auto spin = ui::SpinButton( ui::Adjustment( 0, -8192, 8192, 2, 8, 0 ), 0, 2 );
                                m_rotateIncrement.m_spin = spin;
                                m_rotateSpinner.connect( spin );
-                               gtk_widget_show( GTK_WIDGET( spin ) );
+                               spin.show();
                                gtk_table_attach( GTK_TABLE( table ), GTK_WIDGET( spin ), 1, 2, 4, 5,
                                                                  (GtkAttachOptions) ( GTK_FILL ),
                                                                  (GtkAttachOptions) ( 0 ), 0, 0 );
@@ -788,7 +788,7 @@ ui::Window SurfaceInspector::BuildDialog(){
                        }
                        {
                                ui::Widget label = ui::Label( "Step" );
-                               gtk_widget_show( label );
+                               label.show();
                                gtk_misc_set_alignment( GTK_MISC( label ), 0, 0 );
                                gtk_table_attach( GTK_TABLE( table ), label, 2, 3, 4, 5,
                                                                  (GtkAttachOptions) ( GTK_FILL ),
@@ -796,7 +796,7 @@ ui::Window SurfaceInspector::BuildDialog(){
                        }
                        {
                                auto entry = ui::Entry();
-                               gtk_widget_show( GTK_WIDGET( entry ) );
+                               entry.show();
                                gtk_table_attach( GTK_TABLE( table ), GTK_WIDGET( entry ), 3, 4, 4, 5,
                                                                  (GtkAttachOptions) ( GTK_FILL ),
                                                                  (GtkAttachOptions) ( 0 ), 0, 0 );
@@ -807,7 +807,7 @@ ui::Window SurfaceInspector::BuildDialog(){
                        {
                                // match grid button
                                ui::Widget button = ui::Button( "Match Grid" );
-                               gtk_widget_show( button );
+                               button.show();
                                gtk_table_attach( GTK_TABLE( table ), button, 2, 4, 5, 6,
                                                                  (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                                                  (GtkAttachOptions) ( 0 ), 0, 0 );
@@ -817,46 +817,46 @@ ui::Window SurfaceInspector::BuildDialog(){
 
                {
                        ui::Widget frame = ui::Frame( "Texturing" );
-                       gtk_widget_show( frame );
+                       frame.show();
                        gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( frame ), FALSE, FALSE, 0 );
                        {
                                ui::Widget table = ui::Table( 4, 4, FALSE );
-                               gtk_widget_show( table );
+                               table.show();
                                gtk_container_add( GTK_CONTAINER( frame ), table );
                                gtk_table_set_row_spacings( GTK_TABLE( table ), 5 );
                                gtk_table_set_col_spacings( GTK_TABLE( table ), 5 );
                                gtk_container_set_border_width( GTK_CONTAINER( table ), 5 );
                                {
                                        ui::Widget label = ui::Label( "Brush" );
-                                       gtk_widget_show( label );
+                                       label.show();
                                        gtk_table_attach( GTK_TABLE( table ), label, 0, 1, 0, 1,
                                                                          (GtkAttachOptions) ( GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
                                }
                                {
                                        ui::Widget label = ui::Label( "Patch" );
-                                       gtk_widget_show( label );
+                                       label.show();
                                        gtk_table_attach( GTK_TABLE( table ), label, 0, 1, 2, 3,
                                                                          (GtkAttachOptions) ( GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
                                }
                                {
                                        ui::Widget label = ui::Label( "Width" );
-                                       gtk_widget_show( label );
+                                       label.show();
                                        gtk_table_attach( GTK_TABLE( table ), label, 2, 3, 0, 1,
                                                                          (GtkAttachOptions) ( GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
                                }
                                {
                                        ui::Widget label = ui::Label( "Height" );
-                                       gtk_widget_show( label );
+                                       label.show();
                                        gtk_table_attach( GTK_TABLE( table ), label, 3, 4, 0, 1,
                                                                          (GtkAttachOptions) ( GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
                                }
                                {
                                        ui::Widget button = ui::Button( "Axial" );
-                                       gtk_widget_show( button );
+                                       button.show();
                                        gtk_table_attach( GTK_TABLE( table ), button, 0, 1, 1, 2,
                                                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
@@ -866,7 +866,7 @@ ui::Window SurfaceInspector::BuildDialog(){
                                }
                                {
                                        ui::Widget button = ui::Button( "Fit" );
-                                       gtk_widget_show( button );
+                                       button.show();
                                        gtk_table_attach( GTK_TABLE( table ), button, 1, 2, 1, 2,
                                                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
@@ -876,7 +876,7 @@ ui::Window SurfaceInspector::BuildDialog(){
                                }
                                {
                                        ui::Widget button = ui::Button( "CAP" );
-                                       gtk_widget_show( button );
+                                       button.show();
                                        gtk_table_attach( GTK_TABLE( table ), button, 0, 1, 3, 4,
                                                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
@@ -886,7 +886,7 @@ ui::Window SurfaceInspector::BuildDialog(){
                                }
                                {
                                        ui::Widget button = ui::Button( "Set..." );
-                                       gtk_widget_show( button );
+                                       button.show();
                                        gtk_table_attach( GTK_TABLE( table ), button, 1, 2, 3, 4,
                                                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
@@ -896,7 +896,7 @@ ui::Window SurfaceInspector::BuildDialog(){
                                }
                                {
                                        ui::Widget button = ui::Button( "Natural" );
-                                       gtk_widget_show( button );
+                                       button.show();
                                        gtk_table_attach( GTK_TABLE( table ), button, 2, 3, 3, 4,
                                                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
@@ -906,7 +906,7 @@ ui::Window SurfaceInspector::BuildDialog(){
                                }
                                {
                                        ui::Widget button = ui::Button( "Fit" );
-                                       gtk_widget_show( button );
+                                       button.show();
                                        gtk_table_attach( GTK_TABLE( table ), button, 3, 4, 3, 4,
                                                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
@@ -916,7 +916,7 @@ ui::Window SurfaceInspector::BuildDialog(){
                                }
                                {
                                        ui::Widget spin = ui::SpinButton( ui::Adjustment( 1, 0, 1 << 16, 1, 10, 0 ), 0, 6 );
-                                       gtk_widget_show( spin );
+                                       spin.show();
                                        gtk_table_attach( GTK_TABLE( table ), spin, 2, 3, 1, 2,
                                                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
@@ -925,7 +925,7 @@ ui::Window SurfaceInspector::BuildDialog(){
                                }
                                {
                                        ui::Widget spin = ui::SpinButton( ui::Adjustment( 1, 0, 1 << 16, 1, 10, 0 ), 0, 6 );
-                                       gtk_widget_show( spin );
+                                       spin.show();
                                        gtk_table_attach( GTK_TABLE( table ), spin, 3, 4, 1, 2,
                                                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
@@ -936,17 +936,17 @@ ui::Window SurfaceInspector::BuildDialog(){
                }
                if ( !string_empty( g_pGameDescription->getKeyValue( "si_flags" ) ) ) {
                        {
-                               GtkFrame* frame = ui::Frame( "Surface Flags" );
-                               gtk_widget_show( GTK_WIDGET( frame ) );
+                               auto frame = ui::Frame( "Surface Flags" );
+                               frame.show();
                                gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( frame ), TRUE, TRUE, 0 );
                                {
-                                       GtkVBox* vbox3 = ui::VBox( FALSE, 4 );
+                                       auto vbox3 = ui::VBox( FALSE, 4 );
                                        //gtk_container_set_border_width(GTK_CONTAINER(vbox3), 4);
-                                       gtk_widget_show( GTK_WIDGET( vbox3 ) );
+                                       vbox3.show();
                                        gtk_container_add( GTK_CONTAINER( frame ), GTK_WIDGET( vbox3 ) );
                                        {
-                                               GtkTable* table = ui::Table( 8, 4, FALSE );
-                                               gtk_widget_show( GTK_WIDGET( table ) );
+                                               auto table = ui::Table( 8, 4, FALSE );
+                                               table.show();
                                                gtk_box_pack_start( GTK_BOX( vbox3 ), GTK_WIDGET( table ), TRUE, TRUE, 0 );
                                                gtk_table_set_row_spacings( table, 0 );
                                                gtk_table_set_col_spacings( table, 0 );
@@ -957,8 +957,8 @@ ui::Window SurfaceInspector::BuildDialog(){
                                                {
                                                        for ( int r = 0; r != 8; ++r )
                                                        {
-                                                               GtkCheckButton* check = ui::CheckButton( getSurfaceFlagName( c * 8 + r ) );
-                                                               gtk_widget_show( GTK_WIDGET( check ) );
+                                                               auto check = ui::CheckButton( getSurfaceFlagName( c * 8 + r ) );
+                                                               check.show();
                                                                gtk_table_attach( table, GTK_WIDGET( check ), c, c + 1, r, r + 1,
                                                                                                  (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
                                                                                                  (GtkAttachOptions)( 0 ), 0, 0 );
@@ -971,18 +971,18 @@ ui::Window SurfaceInspector::BuildDialog(){
                                }
                        }
                        {
-                               GtkFrame* frame = ui::Frame( "Content Flags" );
-                               gtk_widget_show( GTK_WIDGET( frame ) );
+                               auto frame = ui::Frame( "Content Flags" );
+                               frame.show();
                                gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( frame ), TRUE, TRUE, 0 );
                                {
-                                       GtkVBox* vbox3 = ui::VBox( FALSE, 4 );
+                                       auto vbox3 = ui::VBox( FALSE, 4 );
                                        //gtk_container_set_border_width(GTK_CONTAINER(vbox3), 4);
-                                       gtk_widget_show( GTK_WIDGET( vbox3 ) );
+                                       vbox3.show();
                                        gtk_container_add( GTK_CONTAINER( frame ), GTK_WIDGET( vbox3 ) );
                                        {
 
-                                               GtkTable* table = ui::Table( 8, 4, FALSE );
-                                               gtk_widget_show( GTK_WIDGET( table ) );
+                                               auto table = ui::Table( 8, 4, FALSE );
+                                               table.show();
                                                gtk_box_pack_start( GTK_BOX( vbox3 ), GTK_WIDGET( table ), TRUE, TRUE, 0 );
                                                gtk_table_set_row_spacings( table, 0 );
                                                gtk_table_set_col_spacings( table, 0 );
@@ -993,8 +993,8 @@ ui::Window SurfaceInspector::BuildDialog(){
                                                {
                                                        for ( int r = 0; r != 8; ++r )
                                                        {
-                                                               GtkCheckButton* check = ui::CheckButton( getContentFlagName( c * 8 + r ) );
-                                                               gtk_widget_show( GTK_WIDGET( check ) );
+                                                               auto check = ui::CheckButton( getContentFlagName( c * 8 + r ) );
+                                                               check.show();
                                                                gtk_table_attach( table, GTK_WIDGET( check ), c, c + 1, r, r + 1,
                                                                                                  (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
                                                                                                  (GtkAttachOptions)( 0 ), 0, 0 );
@@ -1010,18 +1010,18 @@ ui::Window SurfaceInspector::BuildDialog(){
                                }
                        }
                        {
-                               GtkFrame* frame = ui::Frame( "Value" );
-                               gtk_widget_show( GTK_WIDGET( frame ) );
+                               auto frame = ui::Frame( "Value" );
+                               frame.show();
                                gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( frame ), TRUE, TRUE, 0 );
                                {
-                                       GtkVBox* vbox3 = ui::VBox( FALSE, 4 );
+                                       auto vbox3 = ui::VBox( FALSE, 4 );
                                        gtk_container_set_border_width( GTK_CONTAINER( vbox3 ), 4 );
-                                       gtk_widget_show( GTK_WIDGET( vbox3 ) );
+                                       vbox3.show();
                                        gtk_container_add( GTK_CONTAINER( frame ), GTK_WIDGET( vbox3 ) );
 
                                        {
                                                auto entry = ui::Entry();
-                                               gtk_widget_show( GTK_WIDGET( entry ) );
+                                               entry.show();
                                                gtk_box_pack_start( GTK_BOX( vbox3 ), GTK_WIDGET( entry ), TRUE, TRUE, 0 );
                                                m_valueEntryWidget = entry;
                                                m_valueEntry.connect( entry );
@@ -1034,7 +1034,7 @@ ui::Window SurfaceInspector::BuildDialog(){
                if ( g_bp_globals.m_texdefTypeId == TEXDEFTYPEID_BRUSHPRIMITIVES ) {
 // Shamus: Textool goodies...
                        ui::Widget frame = ui::Frame( "Textool" );
-                       gtk_widget_show( frame );
+                       frame.show();
                        gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( frame ), FALSE, FALSE, 0 );
                        {
                                //Prolly should make this a member or global var, so the SI can draw on it...
@@ -1044,7 +1044,7 @@ ui::Window SurfaceInspector::BuildDialog(){
                                gtk_widget_set_events( TexTool::g_textoolWin, GDK_DESTROY | GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK );
                                gtk_widget_set_can_focus( TexTool::g_textoolWin, true );
                                // <-- end stuff...
-                               gtk_widget_show( TexTool::g_textoolWin );
+                               TexTool::g_textoolWin.show();
                                gtk_widget_set_size_request( TexTool::g_textoolWin, -1, 240 ); //Yeah!
                                gtk_container_add( GTK_CONTAINER( frame ), TexTool::g_textoolWin );
 
@@ -1056,13 +1056,13 @@ ui::Window SurfaceInspector::BuildDialog(){
                        }
                        {
                                ui::Widget hbox = ui::HBox( FALSE, 5 );
-                               gtk_widget_show( hbox );
+                               hbox.show();
                                gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( hbox ), FALSE, FALSE, 0 );
                                // Checkboxes go here... (Flip X/Y)
                                ui::Widget flipX = ui::CheckButton( "Flip X axis" );
                                ui::Widget flipY = ui::CheckButton( "Flip Y axis" );
-                               gtk_widget_show( flipX );
-                               gtk_widget_show( flipY );
+                               flipX.show();
+                               flipY.show();
                                gtk_box_pack_start( GTK_BOX( hbox ), flipX, FALSE, FALSE, 0 );
                                gtk_box_pack_start( GTK_BOX( hbox ), flipY, FALSE, FALSE, 0 );
 
index c9a03e4a6fae36c9569eb4110e29b304492592a6..d6b2b8124a301aedaeba6f90e8ef26b78b31e7cc 100644 (file)
@@ -1364,7 +1364,7 @@ gboolean TextureBrowser_button_press( ui::Widget widget, GdkEventButton* event,
                                BuildStoreAssignedTags( textureBrowser->m_assigned_store, textureBrowser->shader.c_str(), textureBrowser );
                                BuildStoreAvailableTags( textureBrowser->m_available_store, textureBrowser->m_assigned_store, textureBrowser->m_all_tags, textureBrowser );
                                textureBrowser->m_heightChanged = true;
-                               gtk_widget_show( textureBrowser->m_tag_frame );
+                               textureBrowser->m_tag_frame.show();
 
                                process_gui();
 
@@ -2009,7 +2009,7 @@ ui::Widget TextureBrowser_constructWindow( ui::Window toplevel ){
        ui::Widget frame_table;
        ui::Widget vbox = ui::VBox( FALSE, 0 );
        gtk_table_attach( GTK_TABLE( table ), vbox, 0, 1, 1, 3, GTK_FILL, GTK_FILL, 0, 0 );
-       gtk_widget_show( vbox );
+       vbox.show();
 
        ui::Widget menu_bar;
 
@@ -2026,7 +2026,7 @@ ui::Widget TextureBrowser_constructWindow( ui::Window toplevel ){
                gtk_menu_shell_append( GTK_MENU_SHELL( menu_bar ), tools_item );
 
                gtk_table_attach( GTK_TABLE( table ), menu_bar, 0, 3, 0, 1, GTK_FILL, GTK_SHRINK, 0, 0 );
-               gtk_widget_show( menu_bar );
+               menu_bar.show();
        }
        { // Texture TreeView
                g_TextureBrowser.m_scr_win_tree = ui::ScrolledWindow();
@@ -2035,17 +2035,17 @@ ui::Widget TextureBrowser_constructWindow( ui::Window toplevel ){
                // vertical only scrolling for treeview
                gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( g_TextureBrowser.m_scr_win_tree ), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS );
 
-               gtk_widget_show( g_TextureBrowser.m_scr_win_tree );
+               g_TextureBrowser.m_scr_win_tree.show();
 
                TextureBrowser_createTreeViewTree();
 
                gtk_scrolled_window_add_with_viewport( GTK_SCROLLED_WINDOW( g_TextureBrowser.m_scr_win_tree ), GTK_WIDGET( g_TextureBrowser.m_treeViewTree ) );
-               gtk_widget_show( GTK_WIDGET( g_TextureBrowser.m_treeViewTree ) );
+               g_TextureBrowser.m_treeViewTree.show();
        }
        { // gl_widget scrollbar
                ui::Widget w = ui::Widget(gtk_vscrollbar_new( ui::Adjustment( 0,0,0,1,1,0 ) ));
                gtk_table_attach( GTK_TABLE( table ), w, 2, 3, 1, 2, GTK_SHRINK, GTK_FILL, 0, 0 );
-               gtk_widget_show( w );
+               w.show();
                g_TextureBrowser.m_texture_scroll = w;
 
                GtkAdjustment *vadjustment = gtk_range_get_adjustment( GTK_RANGE( g_TextureBrowser.m_texture_scroll ) );
@@ -2061,7 +2061,7 @@ ui::Widget TextureBrowser_constructWindow( ui::Window toplevel ){
                gtk_widget_set_can_focus( g_TextureBrowser.m_gl_widget, true );
 
                gtk_table_attach_defaults( GTK_TABLE( table ), g_TextureBrowser.m_gl_widget, 1, 2, 1, 2 );
-               gtk_widget_show( g_TextureBrowser.m_gl_widget );
+               g_TextureBrowser.m_gl_widget.show();
 
                g_TextureBrowser.m_sizeHandler = g_signal_connect( G_OBJECT( g_TextureBrowser.m_gl_widget ), "size_allocate", G_CALLBACK( TextureBrowser_size_allocate ), &g_TextureBrowser );
                g_TextureBrowser.m_exposeHandler = g_signal_connect( G_OBJECT( g_TextureBrowser.m_gl_widget ), "expose_event", G_CALLBACK( TextureBrowser_expose ), &g_TextureBrowser );
@@ -2101,7 +2101,7 @@ ui::Widget TextureBrowser_constructWindow( ui::Window toplevel ){
                        gtk_tree_selection_set_mode( selection, GTK_SELECTION_MULTIPLE );
 
                        gtk_scrolled_window_add_with_viewport( GTK_SCROLLED_WINDOW( g_TextureBrowser.m_scr_win_tags ), GTK_WIDGET( g_TextureBrowser.m_treeViewTags ) );
-                       gtk_widget_show( GTK_WIDGET( g_TextureBrowser.m_treeViewTags ) );
+                       g_TextureBrowser.m_treeViewTags.show();
                }
                { // Texture/Tag notebook
                        TextureBrowser_constructTagNotebook();
@@ -2120,7 +2120,7 @@ ui::Widget TextureBrowser_constructWindow( ui::Window toplevel ){
 
                        gtk_table_attach( GTK_TABLE( table ), g_TextureBrowser.m_tag_frame, 1, 3, 2, 3, GTK_FILL, GTK_SHRINK, 0, 0 );
 
-                       gtk_widget_show( frame_table );
+                       frame_table.show();
 
                        gtk_container_add( GTK_CONTAINER( g_TextureBrowser.m_tag_frame ), frame_table );
                }
@@ -2146,9 +2146,9 @@ ui::Widget TextureBrowser_constructWindow( ui::Window toplevel ){
 
                        GtkTreeViewColumn* column = ui::TreeViewColumn( "", renderer, {{"text", TAG_COLUMN}} );
                        gtk_tree_view_append_column( GTK_TREE_VIEW( g_TextureBrowser.m_assigned_tree ), column );
-                       gtk_widget_show( g_TextureBrowser.m_assigned_tree );
+                       g_TextureBrowser.m_assigned_tree.show();
 
-                       gtk_widget_show( scrolled_win );
+                       scrolled_win.show();
                        gtk_scrolled_window_add_with_viewport( GTK_SCROLLED_WINDOW( scrolled_win ), GTK_WIDGET( g_TextureBrowser.m_assigned_tree ) );
 
                        gtk_table_attach( GTK_TABLE( frame_table ), scrolled_win, 0, 1, 1, 3, GTK_FILL, GTK_FILL, 0, 0 );
@@ -2174,9 +2174,9 @@ ui::Widget TextureBrowser_constructWindow( ui::Window toplevel ){
 
                        GtkTreeViewColumn* column = ui::TreeViewColumn( "", renderer, {{"text", TAG_COLUMN}} );
                        gtk_tree_view_append_column( GTK_TREE_VIEW( g_TextureBrowser.m_available_tree ), column );
-                       gtk_widget_show( g_TextureBrowser.m_available_tree );
+                       g_TextureBrowser.m_available_tree.show();
 
-                       gtk_widget_show( scrolled_win );
+                       scrolled_win.show();
                        gtk_scrolled_window_add_with_viewport( GTK_SCROLLED_WINDOW( scrolled_win ), GTK_WIDGET( g_TextureBrowser.m_available_tree ) );
 
                        gtk_table_attach( GTK_TABLE( frame_table ), scrolled_win, 2, 3, 1, 3, GTK_FILL, GTK_FILL, 0, 0 );
@@ -2199,10 +2199,10 @@ ui::Widget TextureBrowser_constructWindow( ui::Window toplevel ){
                        g_signal_connect( G_OBJECT( m_btn_left ), "clicked", G_CALLBACK( TextureBrowser_assignTags ), NULL );
                        g_signal_connect( G_OBJECT( m_btn_right ), "clicked", G_CALLBACK( TextureBrowser_removeTags ), NULL );
 
-                       gtk_widget_show( m_btn_left );
-                       gtk_widget_show( m_btn_right );
-                       gtk_widget_show( m_arrow_left );
-                       gtk_widget_show( m_arrow_right );
+                       m_btn_left.show();
+                       m_btn_right.show();
+                       m_arrow_left.show();
+                       m_arrow_right.show();
                }
                { // tag fram labels
                        ui::Widget m_lbl_assigned = ui::Label( "Assigned" );
@@ -2211,8 +2211,8 @@ ui::Widget TextureBrowser_constructWindow( ui::Window toplevel ){
                        gtk_table_attach( GTK_TABLE( frame_table ), m_lbl_assigned, 0, 1, 0, 1, GTK_EXPAND, GTK_SHRINK, 0, 0 );
                        gtk_table_attach( GTK_TABLE( frame_table ), m_lbl_unassigned, 2, 3, 0, 1, GTK_EXPAND, GTK_SHRINK, 0, 0 );
 
-                       gtk_widget_show( m_lbl_assigned );
-                       gtk_widget_show( m_lbl_unassigned );
+                       m_lbl_assigned.show();
+                       m_lbl_unassigned.show();
                }
        }
        else { // no tag support, show the texture tree only