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

Re: How do I...




The button is really a label inside a container - just happens that
the container is a button.  You can change the label by doing
something like:

    button = (GtkButton *) widget;
    label = button->child;

    gtk_label_set (GTK_WIDGET (label), "Blah");

 -Eric



---Tony Preston <apreston@k2nesoft.com> wrote:
>
> I have an application I am developing on a Linux system.  I decided
to use
> GTK to build an interface.  For the most part while I am confused and
> overwhelmed, I have the basic ideas working and a simple initial
version.
> 
> I am writing an emulator for an old CPU.  I wanted to create a
display that
> sort of mimics the original display, or at least imparts the same
visual
> information.  I have a set of registers that I would like to display
as
> buttons(already doing that), and each represents a bit in the mimiced
> register.  That all works...  Now the part I cannot seem to get to
work...
> 
> Simple example...  a button.  I have a callback function that
toggles the
> bit everytime the button is clicked on.  I want the label to
represent the
> state of the data.  Example:
>                +-+
>    Switches:   |0| <-- text example of a button...:)
>                +-+
> 
>       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.
> 
>   What function do I call to cause the label to change?  I am using
the code
> in table.c from the examples to do this.  I have all my registers
displaying
> and the "interface" works except for this.
> 
> 
> -- 
>          To unsubscribe: mail gtk-app-devel-list-request@redhat.com
with 
>                        "unsubscribe" as the Subject.
> 
> 	Mailing list concerns should be mailed to <listmaster@redhat.com>
> 
> 

_________________________________________________________
DO YOU YAHOO!?
Get your free @yahoo.com address at http://mail.yahoo.com



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