Re: need pointers for working with custom Gtk widgets ...



On Thu, 2007-02-01 at 17:44 +0530, Sameer Sahasrabuddhe wrote:
Hello,

I have been working on bug 60331 ("Object properties should handle
multiple objects")

http://bugzilla.gnome.org/show_bug.cgi?id=60331

 ... the basic idea is to make the properties dialog keep track of
which properties have been changed by the user. In order for this to
work, every widget in the dialog needs to register the default
signal_handler for suitable signals.

Yay!  I'm happy to hear this.

But the problem is lib/prop_attrs.c ... for custom widgets, it is
difficult to decide which signals need to be connected. For example,
linestyleprop_get_widget() creates a custom widget called
DiaLineStyleSelector, using the function dia_line_style_creator_new().
The pointer returned by this function is for a GtkWidget. Can this be
cast back into DiaLineStyleSelector? Or even better, can a pointer to
the custom widget be returned instead of a generic GtkWidget* ? How
does one do this in Gtk?

The standard appears to be that the _new() functions return a GtkWidget
that you then cast back, see http://gtk.org/tutorial/x2202.html --
though not all standard Gtk widgets follow this, though there may be a
reason behind that.

-Lars




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