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

Re: How do I...




On Tue, 3 Nov 1998, Tony Preston wrote:
> 
>       when "clicked", the label changes to "1"  and when clicked again
>       back to "0".  I have it working except that I cannot get the label
>       to be updated.
> 

You need a pointer to the label, then call gtk_label_set in the "clicked"
callback (or "toggled", if you are using the toggle button).

You can probably do GTK_LABEL(GTK_BIN(button)->child), but this is kind
of disturbing; if you later add a pixmap to the button, for example, the
code will break because the child will not be a label.

So it is possibly nicer to add a label manually instead of using
gtk_button_new_with_label, then you can keep around a pointer to the
label.

Havoc




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