[Glade-users] Question How to create new widget using libglade ?



Renaud Malaval wrote:
Hello,

 Did somebody get an idea if it is possible to make a new widget using
glade and libglade to discribe it ?
 Or is this idea completely crazy ?

I think that what you are imagining is completely crazy.

glade/libglade is a tool to create a ui layout description (glade file)
and use it to build objects in your GUI.

Your dialog, is an object in your GUI... so it should probably
be created by glade... not use libglade to "create itself"... that
is a backwards idea.

If you want to subclass the GtkAboutDialog, add features to it and/or
change some functionality... you can do so... and then add it to
glade-3 (docs about adding your widgets: http://gnome.org/~tvb/glade_api/)...
and then use libglade to load your custom object (need to create
a simple libglade module to load your widgets after that). This would
allow you to fully customize & subclass your dialog simultainiously.

You could ofcourse derive a GtkWindow and fill the contents using a child
object built by libglade (and reparent it into your window subclass after
parsing the glade file in your object's methods)... but I think this is
very bad design, it means that you have to install multiple glade files
to describe your ui... and you have to consider what happens in recursive
situations (i.e. what if your derived widget loads widgets that are also
derived and then you have this highly recursive mess...).

Cheers,
                             -Tristan




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