diff --git a/radiant/dialog.cpp b/radiant/dialog.cpp index fbbe7560..7f1fab4d 100644 --- a/radiant/dialog.cpp +++ b/radiant/dialog.cpp @@ -486,11 +486,11 @@ void Dialog::addCombo( GtkWidget* vbox, const char* name, StringArrayRange value GtkWidget* alignment = gtk_alignment_new( 0.0, 0.5, 0.0, 0.0 ); gtk_widget_show( alignment ); { - GtkWidget* combo = gtk_combo_box_new_text(); + GtkWidget* combo = gtk_combo_box_text_new(); for ( StringArrayRange::Iterator i = values.first; i != values.last; ++i ) { - gtk_combo_box_append_text( GTK_COMBO_BOX( combo ), *i ); + gtk_combo_box_text_append_text( GTK_COMBO_BOX_TEXT( combo ), *i ); } AddIntComboData( *GTK_COMBO_BOX( combo ), importViewer, exportViewer ); diff --git a/radiant/entityinspector.cpp b/radiant/entityinspector.cpp index 529a19b4..fd36e685 100644 --- a/radiant/entityinspector.cpp +++ b/radiant/entityinspector.cpp @@ -773,17 +773,17 @@ ListAttribute( const char* key, const ListAttributeType& type ) : m_combo( 0 ), m_nonModal( ApplyCaller( *this ) ), m_type( type ){ - GtkComboBox* combo = GTK_COMBO_BOX( gtk_combo_box_new_text() ); + GtkWidget* combo = gtk_combo_box_text_new(); for ( ListAttributeType::const_iterator i = type.begin(); i != type.end(); ++i ) { - gtk_combo_box_append_text( GTK_COMBO_BOX( combo ), ( *i ).first.c_str() ); + gtk_combo_box_text_append_text( GTK_COMBO_BOX_TEXT( combo ), ( *i ).first.c_str() ); } - gtk_widget_show( GTK_WIDGET( combo ) ); - m_nonModal.connect( combo ); + gtk_widget_show( combo ); + m_nonModal.connect( GTK_COMBO_BOX( combo ) ); - m_combo = combo; + m_combo = GTK_COMBO_BOX( combo ); } void release(){ delete this; diff --git a/radiant/gtkdlgs.cpp b/radiant/gtkdlgs.cpp index 3c2eb196..7ea95f83 100644 --- a/radiant/gtkdlgs.cpp +++ b/radiant/gtkdlgs.cpp @@ -155,23 +155,18 @@ inline void path_copy_clean( char* destination, const char* source ){ struct GameCombo { - GtkComboBox* game_select; + GtkComboBoxText* game_select; GtkEntry* fsgame_entry; }; gboolean OnSelchangeComboWhatgame( GtkWidget *widget, GameCombo* combo ){ - const char *gamename; - { - GtkTreeIter iter; - gtk_combo_box_get_active_iter( combo->game_select, &iter ); - gtk_tree_model_get( gtk_combo_box_get_model( combo->game_select ), &iter, 0, (gpointer*)&gamename, -1 ); + if( gchar* gamename = gtk_combo_box_text_get_active_text( combo->game_select ) ){ + gamecombo_t gamecombo = gamecombo_for_gamename( gamename ); + + gtk_entry_set_text( combo->fsgame_entry, gamecombo.fs_game ); + gtk_widget_set_sensitive( GTK_WIDGET( combo->fsgame_entry ), gamecombo.sensitive ); + g_free( gamename ); } - - gamecombo_t gamecombo = gamecombo_for_gamename( gamename ); - - gtk_entry_set_text( combo->fsgame_entry, gamecombo.fs_game ); - gtk_widget_set_sensitive( GTK_WIDGET( combo->fsgame_entry ), gamecombo.sensitive ); - return FALSE; } @@ -240,20 +235,20 @@ GtkWindow* ProjectSettingsDialog_construct( ProjectSettingsDialog& dialog, Modal gtk_misc_set_alignment( GTK_MISC( label ), 1, 0.5 ); } { - dialog.game_combo.game_select = GTK_COMBO_BOX( gtk_combo_box_new_text() ); + GtkComboBoxText* combo = dialog.game_combo.game_select = GTK_COMBO_BOX_TEXT( gtk_combo_box_text_new() ); - gtk_combo_box_append_text( dialog.game_combo.game_select, globalGameComboConfiguration().basegame ); + gtk_combo_box_text_append_text( combo, globalGameComboConfiguration().basegame ); if ( globalGameComboConfiguration().known[0] != '\0' ) { - gtk_combo_box_append_text( dialog.game_combo.game_select, globalGameComboConfiguration().known ); + gtk_combo_box_text_append_text( combo, globalGameComboConfiguration().known ); } - gtk_combo_box_append_text( dialog.game_combo.game_select, globalGameComboConfiguration().custom ); + gtk_combo_box_text_append_text( combo, globalGameComboConfiguration().custom ); - gtk_widget_show( GTK_WIDGET( dialog.game_combo.game_select ) ); - gtk_table_attach( table2, GTK_WIDGET( dialog.game_combo.game_select ), 1, 2, 0, 1, + gtk_widget_show( GTK_WIDGET( combo ) ); + gtk_table_attach( table2, GTK_WIDGET( combo ), 1, 2, 0, 1, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); - g_signal_connect( G_OBJECT( dialog.game_combo.game_select ), "changed", G_CALLBACK( OnSelchangeComboWhatgame ), &dialog.game_combo ); + g_signal_connect( G_OBJECT( combo ), "changed", G_CALLBACK( OnSelchangeComboWhatgame ), &dialog.game_combo ); } { @@ -282,16 +277,16 @@ GtkWindow* ProjectSettingsDialog_construct( ProjectSettingsDialog& dialog, Modal (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_misc_set_alignment( GTK_MISC( label ), 1, 0.5 ); - GtkComboBox* combo = GTK_COMBO_BOX( gtk_combo_box_new_text() ); - gtk_combo_box_append_text( combo, globalMappingMode().sp_mapping_mode ); - gtk_combo_box_append_text( combo, globalMappingMode().mp_mapping_mode ); + GtkComboBoxText* combo = GTK_COMBO_BOX_TEXT( gtk_combo_box_text_new() ); + 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 ) ); gtk_table_attach( table2, GTK_WIDGET( combo ), 1, 2, 3, 4, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); - dialog.gamemode_combo = combo; + dialog.gamemode_combo = GTK_COMBO_BOX( combo ); } } } @@ -301,7 +296,7 @@ GtkWindow* ProjectSettingsDialog_construct( ProjectSettingsDialog& dialog, Modal const char* dir = gamename_get(); gamecombo_t gamecombo = gamecombo_for_dir( dir ); - gtk_combo_box_set_active( dialog.game_combo.game_select, gamecombo.game ); + gtk_combo_box_set_active( GTK_COMBO_BOX( dialog.game_combo.game_select ), gamecombo.game ); gtk_entry_set_text( dialog.game_combo.fsgame_entry, gamecombo.fs_game ); gtk_widget_set_sensitive( GTK_WIDGET( dialog.game_combo.fsgame_entry ), gamecombo.sensitive ); diff --git a/radiant/patchdialog.cpp b/radiant/patchdialog.cpp index 20079f86..3a4702fc 100644 --- a/radiant/patchdialog.cpp +++ b/radiant/patchdialog.cpp @@ -227,8 +227,8 @@ float m_fZ; float m_fVShift; */ int m_nCol; int m_nRow; -GtkComboBox *m_pRowCombo; -GtkComboBox *m_pColCombo; +GtkComboBoxText *m_pRowCombo; +GtkComboBoxText *m_pColCombo; std::size_t m_countRows; std::size_t m_countCols; @@ -604,29 +604,27 @@ GtkWindow* PatchInspector::BuildDialog(){ (GtkAttachOptions)( 0 ), 0, 0 ); } { - GtkComboBox* combo = GTK_COMBO_BOX( gtk_combo_box_new_text() ); + GtkComboBoxText* combo = m_pRowCombo = GTK_COMBO_BOX_TEXT( gtk_combo_box_text_new() ); g_signal_connect( G_OBJECT( combo ), "changed", G_CALLBACK( OnSelchangeComboColRow ), this ); - AddDialogData( *combo, m_nRow ); + AddDialogData( *GTK_COMBO_BOX( combo ), m_nRow ); gtk_widget_show( GTK_WIDGET( combo ) ); gtk_table_attach( table, GTK_WIDGET( combo ), 0, 1, 1, 2, (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions)( 0 ), 0, 0 ); gtk_widget_set_size_request( GTK_WIDGET( combo ), 60, -1 ); - m_pRowCombo = combo; } { - GtkComboBox* combo = GTK_COMBO_BOX( gtk_combo_box_new_text() ); + GtkComboBoxText* combo = m_pColCombo = GTK_COMBO_BOX_TEXT( gtk_combo_box_text_new() ); g_signal_connect( G_OBJECT( combo ), "changed", G_CALLBACK( OnSelchangeComboColRow ), this ); - AddDialogData( *combo, m_nCol ); + AddDialogData( *GTK_COMBO_BOX( combo ), m_nCol ); gtk_widget_show( GTK_WIDGET( combo ) ); gtk_table_attach( table, GTK_WIDGET( combo ), 1, 2, 1, 2, (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions)( 0 ), 0, 0 ); gtk_widget_set_size_request( GTK_WIDGET( combo ), 60, -1 ); - m_pColCombo = combo; } } GtkTable* table = GTK_TABLE( gtk_table_new( 5, 2, FALSE ) ); @@ -1059,11 +1057,11 @@ void PatchInspector::GetPatchInfo(){ m_bListenChanged = false; { - gtk_combo_box_set_active( m_pRowCombo, 0 ); + gtk_combo_box_set_active( GTK_COMBO_BOX( m_pRowCombo ), 0 ); for ( std::size_t i = 0; i < m_countRows; ++i ) { - gtk_combo_box_remove_text( m_pRowCombo, gint( m_countRows - i - 1 ) ); + gtk_combo_box_text_remove( m_pRowCombo, gint( m_countRows - i - 1 ) ); } m_countRows = m_Patch->getHeight(); @@ -1071,18 +1069,18 @@ void PatchInspector::GetPatchInfo(){ { char buffer[16]; sprintf( buffer, "%u", Unsigned( i ) ); - gtk_combo_box_append_text( m_pRowCombo, buffer ); + gtk_combo_box_text_append_text( m_pRowCombo, buffer ); } - gtk_combo_box_set_active( m_pRowCombo, 0 ); + gtk_combo_box_set_active( GTK_COMBO_BOX( m_pRowCombo ), 0 ); } { - gtk_combo_box_set_active( m_pColCombo, 0 ); + gtk_combo_box_set_active( GTK_COMBO_BOX( m_pColCombo ), 0 ); for ( std::size_t i = 0; i < m_countCols; ++i ) { - gtk_combo_box_remove_text( m_pColCombo, gint( m_countCols - i - 1 ) ); + gtk_combo_box_text_remove( m_pColCombo, gint( m_countCols - i - 1 ) ); } m_countCols = m_Patch->getWidth(); @@ -1090,10 +1088,10 @@ void PatchInspector::GetPatchInfo(){ { char buffer[16]; sprintf( buffer, "%u", Unsigned( i ) ); - gtk_combo_box_append_text( m_pColCombo, buffer ); + gtk_combo_box_text_append_text( m_pColCombo, buffer ); } - gtk_combo_box_set_active( m_pColCombo, 0 ); + gtk_combo_box_set_active( GTK_COMBO_BOX( m_pColCombo ), 0 ); } m_bListenChanged = true; diff --git a/radiant/patchmanip.cpp b/radiant/patchmanip.cpp index 62c71100..45cdeef5 100644 --- a/radiant/patchmanip.cpp +++ b/radiant/patchmanip.cpp @@ -1011,8 +1011,8 @@ void DoNewPatchDlg( EPatchPrefab prefab, int minrows, int mincols, int defrows, } { - GtkComboBox* combo = GTK_COMBO_BOX( gtk_combo_box_new_text() ); -#define D_ITEM( x ) if ( x >= mincols && ( !maxcols || x <= maxcols ) ) gtk_combo_box_append_text( combo, # x ) + GtkComboBoxText* combo = GTK_COMBO_BOX_TEXT( gtk_combo_box_text_new() ); +#define D_ITEM( x ) if ( x >= mincols && ( !maxcols || x <= maxcols ) ) gtk_combo_box_text_append_text( combo, # x ) D_ITEM( 3 ); D_ITEM( 5 ); D_ITEM( 7 ); @@ -1034,11 +1034,11 @@ void DoNewPatchDlg( EPatchPrefab prefab, int minrows, int mincols, int defrows, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); - width = combo; + width = GTK_COMBO_BOX( combo ); } { - GtkComboBox* combo = GTK_COMBO_BOX( gtk_combo_box_new_text() ); -#define D_ITEM( x ) if ( x >= minrows && ( !maxrows || x <= maxrows ) ) gtk_combo_box_append_text( combo, # x ) + GtkComboBoxText* combo = GTK_COMBO_BOX_TEXT( gtk_combo_box_text_new() ); +#define D_ITEM( x ) if ( x >= minrows && ( !maxrows || x <= maxrows ) ) gtk_combo_box_text_append_text( combo, # x ) D_ITEM( 3 ); D_ITEM( 5 ); D_ITEM( 7 ); @@ -1060,7 +1060,7 @@ void DoNewPatchDlg( EPatchPrefab prefab, int minrows, int mincols, int defrows, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); - height = combo; + height = GTK_COMBO_BOX( combo ); } if( prefab != ePlane ){