bug-gnubg
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-gnubg] changing GTK label from callback


From: Olivier Baur
Subject: Re: [Bug-gnubg] changing GTK label from callback
Date: Sat, 19 Jul 2003 01:07:26 +0200

Le vendredi, 18 juil 2003, à 21:38 Europe/Paris, Holger a écrit :

does anybody know how one can update a GTK label from a signal callback? Just gtk_label_set_text doesn't seem to work.

I've tried to fix "[bug #4288] Incorrect path to MET", showing the MET filename under settings|options|match. After loading a new table I try to change the label text from SetMET(). But it doesn't want to. :( I've even tried:

extern void SetMET( gpointer *p, guint n, GtkWidget *pw ) {
...
if ( p && GTK_WIDGET_VISIBLE( p ) ) {
gtk_label_set_text( GTK_LABEL( p ), miCurrent.szFileName );
/* the following shouldn't be necessary */
gtk_widget_queue_draw( GTK_WIDGET( p ) );
gtk_widget_queue_draw( gtk_widget_get_toplevel( GTK_WIDGET( p ) ) );
gtk_widget_show_all( gtk_widget_get_toplevel( GTK_WIDGET( p ) ) );
}


The problem is the prototype of your callback function is incorrect, and should read:

extern void SetMET( GtkWidget *p, guint n )

I've tried it and it works.


-- Olivier
reply via email to

[Prev in Thread] Current Thread [Next in Thread]