diff --git a/radiant/dialog.cpp b/radiant/dialog.cpp index f7da5c18..98ba454a 100644 --- a/radiant/dialog.cpp +++ b/radiant/dialog.cpp @@ -168,19 +168,19 @@ void Dialog::UpdateData( bool retrieve ){ break; case DLG_COMBO_INT: { - GList *lst = GTK_LIST( GTK_COMBO( data->object )->list )->children; - char *label; - const char *entry; + GList *lst = gtk_container_get_children( GTK_CONTAINER( GTK_COMBO( data->object )->list ) ); + const char *labeltext; + const char *entrytext; int i; *(int*)data->buffer = -1; - entry = gtk_entry_get_text( GTK_ENTRY( GTK_COMBO( data->object )->entry ) ); + entrytext = gtk_entry_get_text( GTK_ENTRY( GTK_COMBO( data->object )->entry ) ); for ( i = 0; lst != NULL; lst = g_list_next( lst ) ) { - label = gtk_label_get_text( GTK_LABEL( lst->data ) ); + labeltext = gtk_label_get_text( GTK_LABEL( gtk_bin_get_child( GTK_BIN( lst->data ) ) ) ); - if ( strcmp( label, entry ) == 0 ) { + if ( strcmp( labeltext, entrytext ) == 0 ) { *(int*)data->buffer = i; break; } @@ -238,20 +238,21 @@ void Dialog::UpdateData( bool retrieve ){ gtk_adjustment_set_value( GTK_ADJUSTMENT( data->object ), ( *(int*)data->buffer ) ); break; case DLG_COMBO_INT: { - GList *lst = GTK_LIST( GTK_COMBO( data->object )->list )->children; - char *entry = NULL; + GList *lst = gtk_container_get_children( GTK_CONTAINER( GTK_COMBO( data->object )->list ) ); + const char *text = NULL; + GtkEntry *entry = GTK_ENTRY( GTK_COMBO( data->object )->entry ); if ( *(int*)data->buffer != -1 ) { lst = g_list_nth( lst, *(int*)data->buffer ); if ( lst != NULL ) { - entry = gtk_label_get_text( GTK_LABEL( lst->data ) ); + text = gtk_label_get_text( GTK_LABEL( gtk_bin_get_child( GTK_BIN( lst->data ) ) ) ); } } - if ( entry ) { - gtk_entry_set_text( GTK_ENTRY( GTK_COMBO( data->object )->entry ), entry ); + if ( text ) { + gtk_entry_set_text( entry, text ); } else{ - gtk_entry_set_text( GTK_ENTRY( GTK_COMBO( data->object )->entry ), "" ); + gtk_entry_set_text( entry, "" ); } } break; diff --git a/radiant/findtexturedialog.cpp b/radiant/findtexturedialog.cpp index 5dbf3255..a2fea609 100644 --- a/radiant/findtexturedialog.cpp +++ b/radiant/findtexturedialog.cpp @@ -59,7 +59,7 @@ static void OnClose( GtkWidget *widget, gpointer data ){ static void popup_selected( GtkWidget *widget, gpointer data ){ const gchar *str; - str = gtk_label_get_text( GTK_LABEL( widget ) ); + str = gtk_label_get_text( GTK_LABEL( gtk_bin_get_child( GTK_BIN( widget ) ) ) ); gtk_entry_set_text( GTK_ENTRY( data ), str ); }