To reference a widget, you should call


        referenced_widget = lookup_widget(current_widget,"name_of_the_widget");

        
        For example: if we a create a simple button widget on a window, and we
assign a signal for it, callbacks.c will have:

void
on_button1_clicked                     (GtkButton       *button,
                                        gpointer         user_data)
{

}


To set the text data of the widget 'entry1', you should write:

void
on_button1_clicked                     (GtkButton       *button,
                                        gpointer         user_data)
{

        gtk_entry_set_text(GTK_ENTRY(lookup_widget(button),"entry1"),"Glade rulez!");

}



Regards,

Diego Lages



On Wed, Mar 29, 2000 at 01:49:45PM -0300, Ricardo Kohler Costa wrote:
> 
> Hi, I'm a developer from Brazil, I work for a Company that works only with
> Linux. I have a program to convert from plataform Windows to Linux, I
> decided to use Glade, but I have a problem.
> 
> I don't know how to get the reference to the widget created by glade. You
> see that Glade generates a file that mount the screen (interface.c), and
> other for the events (signals - callbacks.c); in the file of events I
> can't get the widget reference, I want to say in that event to get a text
> from a entry, but when I pass the name it gives bugs in making.
> 
> How should I use it? Is there a method to use it?
> Should I use #include "interface.c", EXTERN, or glade gives that support?
> 
> I would apreciate a lot your help, if you colud send me an answer
> or/and an example. I've tryed to get the examples from glade, but my
> machine is not ok, so I'm asking you to send to me.
> 
> Thanks...........RIKC
> 
> 
> 
> +---------------------------------------------------------------------+
> To unsubscribe from this list, send a message to [EMAIL PROTECTED]
> with the line "unsubscribe glade-devel" in the body of the message.

-- 
Diego Delgado Lages - [EMAIL PROTECTED]
IT & Internet Consultant
Linux Solutions - http://www.linuxsolutions.com.br
O Linux - O maior e melhor site de Linux do Brasil - http://www.olinux.com.br
Brazil

+---------------------------------------------------------------------+
To unsubscribe from this list, send a message to [EMAIL PROTECTED]
with the line "unsubscribe glade-devel" in the body of the message.
  • Use Method Ricardo Kohler Costa
    • Diego Delgado Lages

Reply via email to