Re: change text in button



Hi,

Sven Neumann wrote:
Hi,

CAVEY GERARD <GERARD CAVEY sgam com> writes:

  
Objet : change text in button

something like this button->label ?
Or maybe I need to create a new label, and 'give them the color and pack 
it' again into the button?
@@@@@@@@@@@@@@@@@@
hi
in fact the label of a button is stored in the menber child of the button 
so u can simply refer to it
consider the folowing
label = (GtkLabel*) GTK_BUTTON(MyButton)->child;
    

that won't work since the GtkButton struct doesn't have a child member.
In fact a GtkButton is a GtkBin which is a special container with just
one child. So to access the label you should use

 label = GTK_LABEL (GTK_BIN (button)->child);

  
Hi, thanks a lot for you kindly help, it's just great
this worked fine:
gtk_widget_modify_fg (GTK_WIDGET(GTK_LABEL (GTK_BIN (button2[i][j])->child)), GTK_STATE_NORMAL, &color2);

When there would not be such kindly help like from you two, what would have been the way to find out myself the best and quickest way. I was looking for the solution for the above several hours, and was not able to find :-( (Well for this question here right now I did not seaching the archives (sorry) I just ask)

Thanks a lot again
calmar

  


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