Replacing deprecated gtk_widget_ref/unref

This commit is contained in:
Pan7 2017-03-19 11:30:01 +01:00
parent 491aee4b19
commit dc6faca5b0
3 changed files with 7 additions and 7 deletions

View File

@ -310,7 +310,7 @@ bool UpdateSel( int iIndex, eclass_t *pec ){
GtkWidget* widget = EntWidgets[EntCheck1 + i]; GtkWidget* widget = EntWidgets[EntCheck1 + i];
gtk_label_set_text( GTK_LABEL( GTK_BIN( widget )->child ), " " ); gtk_label_set_text( GTK_LABEL( GTK_BIN( widget )->child ), " " );
gtk_widget_hide( widget ); gtk_widget_hide( widget );
gtk_widget_ref( widget ); g_object_ref( widget );
gtk_container_remove( GTK_CONTAINER( LayoutTable ), widget ); gtk_container_remove( GTK_CONTAINER( LayoutTable ), widget );
} }
last_count = spawnflag_count; last_count = spawnflag_count;
@ -328,7 +328,7 @@ bool UpdateSel( int iIndex, eclass_t *pec ){
gtk_table_attach( GTK_TABLE( LayoutTable ), widget, i % 4, i % 4 + 1, i / 4, i / 4 + 1, gtk_table_attach( GTK_TABLE( LayoutTable ), widget, i % 4, i % 4 + 1, i / 4, i / 4 + 1,
(GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( GTK_FILL ), 0, 0 ); (GtkAttachOptions) ( GTK_FILL ), 0, 0 );
gtk_widget_unref( widget ); g_object_unref( widget );
gtk_label_set_text( GTK_LABEL( GTK_BIN( widget )->child ), str.GetBuffer() ); gtk_label_set_text( GTK_LABEL( GTK_BIN( widget )->child ), str.GetBuffer() );
} }
@ -1334,7 +1334,7 @@ void GroupDlg::Create(){
for ( int i = 0; i < MAX_FLAGS; i++ ) for ( int i = 0; i < MAX_FLAGS; i++ )
{ {
GtkWidget* check = gtk_check_button_new_with_label( "" ); GtkWidget* check = gtk_check_button_new_with_label( "" );
gtk_widget_ref( check ); g_object_ref( check );
g_signal_connect( G_OBJECT( check ), "toggled", G_CALLBACK( entity_check ), NULL ); g_signal_connect( G_OBJECT( check ), "toggled", G_CALLBACK( entity_check ), NULL );
EntWidgets[EntCheck1 + i] = check; EntWidgets[EntCheck1 + i] = check;
} }

View File

@ -1713,10 +1713,10 @@ void CheckMenuSplitting( GtkWidget *&menu ){
for ( int i = 0; i < 3; i++ ) for ( int i = 0; i < 3; i++ )
{ {
item = GTK_WIDGET( g_list_last( gtk_container_get_children( GTK_CONTAINER( menu ) ) )->data ); item = GTK_WIDGET( g_list_last( gtk_container_get_children( GTK_CONTAINER( menu ) ) )->data );
gtk_widget_ref( item ); g_object_ref( item );
gtk_container_remove( GTK_CONTAINER( menu ), item ); gtk_container_remove( GTK_CONTAINER( menu ), item );
gtk_menu_append( GTK_MENU( menu2 ), item ); gtk_menu_append( GTK_MENU( menu2 ), item );
gtk_widget_unref( item ); g_object_unref( item );
} }
item = gtk_menu_item_new_with_label( "--------" ); item = gtk_menu_item_new_with_label( "--------" );

View File

@ -1086,7 +1086,7 @@ GtkWidget* CGameDialog::GetGlobalFrame(){
AddDialogData( check, &m_bLogConsole, DLG_CHECK_BOOL ); AddDialogData( check, &m_bLogConsole, DLG_CHECK_BOOL );
// incref it so we can pass it around // incref it so we can pass it around
gtk_widget_ref( GTK_WIDGET( mFrame ) ); g_object_ref( GTK_WIDGET( mFrame ) );
return mFrame; return mFrame;
} }
@ -1341,7 +1341,7 @@ void CGameDialog::Init(){
CGameDialog::~CGameDialog(){ CGameDialog::~CGameDialog(){
if ( mFrame ) { if ( mFrame ) {
// NOTE I'm not too sure how reliable this is // NOTE I'm not too sure how reliable this is
gtk_widget_unref( GTK_WIDGET( mFrame ) ); g_object_unref( GTK_WIDGET( mFrame ) );
} }
// free all the game descriptions // free all the game descriptions
list<CGameDescription *>::iterator iGame; list<CGameDescription *>::iterator iGame;