[Glade-devel] Embedding glade in other applications (like IDE )



On Wed, 2004-01-07 at 18:53, Vomberg István wrote:
2004-01-07, sze keltezéssel 18:37-kor Paolo Borelli ezt írta:
From your question I think to understand that you are not very familiar
with libglade. I suggest that you take a closer look to it and probably
use it in your own application.

Yes.:-)

I develop a really big chemical analytical software by Glade-2, with so
many C code for calculations and data display. The glade file is ~32000
lines and it is not fully finished yet. Will be usable this file in
Glade3?

In *theory* it should work fine, in the sense that the format of the xml
file is the same... but there may be bugs and some widgets that are
still broken. If you are using additional widgets  (e.g. gnome widgets
or gnomedb widgets), those are not supported yet by glade-3.

Anyway just go on and try :-) your computer *shouldn't* take fire, but
if it does I take no responsability ;-)

Of course I don't know how is your app done, but note that if you use
libglade you should probably break up your gui/.glade in smaller and
more manageable pieces, e.g. many gnome apps (as Gedit etc) use a
differnt .glade file for each dialog. A clear separation of the GUI from
the calculation code is also probably a good idea.


Using libglade there is no need to generate any .c file. Glade-3 simply
creates the xml file ( .glade ).

Something is missing to me. What about the callback functions?
Do the Glade3 generate callbacks.c?
How to handle the callbacks?

as I said take a quick look at
http://developer.gnome.org/doc/API/2.0/libglade/libglade.html
and at some apps which use libglade.

callbacks do not need to be in a special big file called callback.c or
whatever; put them near to the objects to which they are connected,
possibly with a static keyword so that they are private to the c file.

Using libglade you can either use the connect and even autoconnect stuff
(
http://developer.gnome.org/doc/API/2.0/libglade/gladexml.html#GLADE-XML-SIGNAL-CONNECT ) but more commonly 
you often use simply g_signal_connect stuff as in pure gtk programming since callback are often the tricky 
part and you want manual control anyway to do some stuff.

Anyway this doesn't matter for glade: think of glade as of a simple tool
to generate/edit the .glade file, in the same way you would do with an
image and the Gimp.

Once you have your .glade file it's up to the programmer do what he
wants with it, in whichever language he chose (be it c, c++, python or
whatever).
You may want to create the .c files with a simple editor (vi, emacs,
etc) or you may prefer to use an IDE wich takes care of creating a
template application for you (Anjuta etc): this isn't something that
belongs into glade, but into an IDE that may want to integrate a glade
component to edit .glade files (which after all what this whole thread
was about)

hope that clarifies

ciao
        paolo





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