Re: change text in button
- From: Sven Neumann <sven gimp org>
- To: CAVEY GERARD <GERARD CAVEY sgam com>
- Cc: "'calmar'" <mac calmar ws>, gtk-list gnome org
- Subject: Re: change text in button
- Date: 16 Oct 2002 13:20:04 +0200
Hi,
CAVEY GERARD <GERARD CAVEY sgam com> writes:
> Objet : change text in button
> I can not change the color of the text (only when I click on the
> butten..the 'markes' that the button is selected are 'red' then.)
> How could I reach the label in the butten in order to change the color?
> 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);
Salut, Sven
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]