[Glade-users] custom widgets: please help



Hello,

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.

Here is what I want to do:

1. Create a custom widget using glade. To keep things simple I want to
   create a widget consisting of a "Window" containing a "Button" which
   contains a "Label" which displays the message "Hello, World!".

2. I then want to create several widgets, each containing one or more
   instances of the HelloWorld widget created in part1. Ideally I would
   like to do this all from a single session by making the custom widget
   from part 1 instantiatable.

Is this possible? If not, then what approach should I use. Could someone
show me complete code for this extremely simple example that uses custom
widget?

(note that this is also useful when using gnu gettext because then the
"Hello, World!" string only needs to be instantiated once, as it comes
from a single place in a single creator function or class. BTW, I am
going to use C, not C++, so interpret class as creator function.
In general, there could be a more complex layout repeated 20
times throughout the application, and a new function to
create the widget really saves lines of output source
code, reduces executable time, and significantly
reduces the time for me to build the glade app,
making things much simpler).

Please show me how to code with this simple approach in glade,

Your help is very much appreciated,

Thanks,

Neil




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