Fwd: [Glade-users] custom widgets: please help


Could someone please show me how to accomplish the following task:

1.  create a small widget with two buttons with glade
2.  use libglade to make a constructor C function for it
3.  make it show up in glade application, and have glade
     actually render the widget as I place it down in glade


I really appreciate it,


On Fri, 15 Oct 2004 18:47:08 -0400, Tristan Van Berkom
<tristan van berkom gmail com> wrote:
On Fri, 15 Oct 2004 15:23:18 -0600, Neil Zanella <nzanella gmail com> wrote:

I am new to glade. I searched the mailing list archives but could
not find an answer to my particular question/scenario.

In the glade "Palette" window there is a button with a blue "C" on it
such that when the cursor is moved over it a tooltip shows up displaying
the message "Custom Widget". When this button is pressed and the user
clicks on the widget layout window a new widget filled with blue "C"s
shows up.

    Just to make sure we are on the same page and are not confused in our terms
etc. A "custom widget" is a GtkWidget class derivitive that does not come with
the GTK+ libraries (or gnome libs for that matter), it is a widget
that you probably
wrote yourself with its own unique GType.

Glade has a mechanism that allows you to create your custom widget regardless
of the fact that it has not been implemented in the glade editor code.

The way it works, is that you provide the stub name (I think the editor calls it
the "creation function") and then you are allowed to provide a few paramaters
for your creation function (string1 and string2 iirc).

Whether you generate code, or make use of libglade (which btw is recommendable
for a bunch of reasons that I wont begin to discuss right now), you will have to
write the "creation function" yourself.

I hope this makes things a little more clear for you ;-)


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