[Glade-users] Need basic help with glade!!!

Matt Hillebrand hill9361@uidaho.edu
Fri, 9 Mar 2001 11:19:13 -0800 (PST)


You can use the function called lookup_widget that is in support.c:

void on_btnSaluta_pressed (GtkButton *button, gpointer user_data)
{
  GtkWidget *lblOutput;

  lblOutput = lookup_widget(GTK_WIDGET(button), "lblOutput");

  <do stuff to label>
}

or you can pass the label as the user_data parameter.

Matthew P. Hillebrand

On Fri, 9 Mar 2001, Alex Damiani wrote:

> Hi! I have just converted myself (at last!!) to Linux, RedHat release 7,
> to be exact.
> I have been using things like C++Builder by Borland under Win
> environments, and I saw that glade does the equivalent of the designing
> part and file creation. When I go to edit the files to make my
> application actually DO something, though, I am faced with a problem. I
> must confess I'm not a wiz (just yet, hopefully), hence this is a very
> basic question.
> I'll give you an example of what I wanna do, so you can help me
> directly, and I can learn from the example...
>
> I have a button, called btnSaluta, I want the user to press that button
> and subsequently change the text displayed in a label called lblOutput
> on the same window as the button (window1, and on a panel fixed1).
> I made an event handler for the "pressed" state of the button,
> automatically called on_btnSaluta_pressed stored in a file called
> callbacks.c
>
> If I try to change the  text attribute of the lblOutput (which, if I'm
> not wrong, I try to do with lblOutput->text), it says lblOutput is
> undeclared.
>
> My question is, how do I access the widgets on my form from this
> callbacks file?
> Also, is there no documentation about how to use glade? My "Help"
> section in glade contains only the "About" option...
>
> Thanking you in advance,
>                                                         Alex
>
>
> _______________________________________________
> Glade-users maillist  -  Glade-users@helixcode.com
> http://lists.helixcode.com/mailman/listinfo/glade-users
>