Re: Developing using Glade



On Thu, 25 Nov 2004 15:00:41 -0800, Adolfo Bravo Ferreira
<adolfo anderung com br> wrote:
[...]
I'm developing more than one window thought glade but when I click in some
button in the main window I want to load this new window IN the main window.
How can I develop using glade? For example: I need to build all the windows
that I need in Glade and then what I need to do in the src code to join the
windows that I need in the main window?

Sorry I was not clear.

No it wasnt very clear but I think I know what you are getting at;

glade is a tool to build the interface, it does give you access to signal
handler connections but IMO its just confusing to use that in the long run,

This is what you need to do:
    - Build your interface / glade file with glade, be sure to name the relavent
      widgets with a relevent name (not "button1" etc...)

    - In you application, use glade_xml_get_widget () to get a handle on the
      three relevent widgets
        * the main window (for gtk_window_present ())
        * the button somewhere inside the main window
        * the dialog window or popup or what ever you want to show when the
          button gets pressed.

    - Connect to the "clicked" signal on the button and pass the
dialog pointer as
      user_data to the callback

    - In the callback present the window.

Now I might sound like a nazi saying this but what the hell, whatever you
do, just dont use the code generation feature in glade; its a depricated
beast that will only cause you problems in the long run.

Cheers,
                                                         -Tristan



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