Re: How to use GTKExtra Widgets with GLADE???
Al Hooton <[email protected]>
| Newsgroups | gmane.comp.scigraphica.gtkextra |
|---|---|
| Message-ID | <1076598071.16868.56.camel@localhost> |
On Wed, 2004-02-11 at 10:14, JOSE PEDRO SERGIO ROMAO MACHADO wrote:
> If so, how can I inegrate GTKExtra widgets in GLADE2 so I
> can use them on my project.
This applies to any widget not included in the Glade-2 pallete, not
just GtkExtra. However, I have used this approach to include GtkExtra
widgets in a Glade-2 app, and it works well:
Look at the documentation for the Glade "custom widget". This widget
can be placed in a container within Glade as normal. It has no inherent
functionality, except as a way to get any widget you wanted created when
the app is initializing, and triggered with events when necessary.
In the properties for the custom widget you will see "Creation
Function". This is the name of a function that will be called by the
code that Glade generates when it needs to create/initialize your
widget. This function is passed four parameters, which are the other
four properties of the custom widget:
GtkWidget *uiPlotInit(gchar *widgetName, gchar *str1, gchar *str2,
gint int1, gint int2)
{
GtkWidget *newWidget;
newWidget = <create new widget call>
return(newWidget);
}
The creation function needs to create the widget you actually want to
use (i.e., GtkPlot, GtkPlotCanvas, GtkSheet, etc.), pack other widgets
in to it as necessary, and return a pointer to the widget you want put
in the container that holds the custom widget in Glade. After that,
everything just works.
The Glade documentation is pretty good on this, also you can find a
little more info if you Google around a bit.
Hope this helps...
-Al
-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click