After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 373110 - add a way to specify constructors of internal objects
add a way to specify constructors of internal objects
Status: RESOLVED DUPLICATE of bug 356864
Product: gtk+
Classification: Platform
Component: .General
unspecified
Other All
: Normal enhancement
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2006-11-09 20:06 UTC by Paul Pogonyshev
Modified: 2006-12-08 20:44 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement



Description Paul Pogonyshev 2006-11-09 20:06:26 UTC
Currently, GtkComboBoxEntry always creates an entry using gtk_entry_new().  It would be great if GTK+ had a way to specify usage of a different construct of GtkEntry-derived object.

I imagine you could specify GType for internal objects and such objects were created with untyped constructor (g_object_new (type, NULL).)  Even more flexible approach would be to use a callback function to specify arbitrary constructor, but I'm not sure how to infer GType from a function...  (Such approach is more flexible since some language bindings don't use GType.)

Probably constructors could be static.  It hardly makes sense or justifies additional effort to use several in one application.

This is a generic problem in GTK+, not limited to combo box entries, but rather to any composite objects/widgets.
Comment 1 Murray Cumming 2006-11-23 15:25:47 UTC
In general, you should never have to deal with internal objects anyway. What can't you do without this? Maybe the answer would be a more specific bug request.
Comment 2 Paul Pogonyshev 2006-11-23 19:06:45 UTC
In my particular case I want C++ objects to be able to synchronize their values with external variables.  I cannot do this currently, because combo box creates an entry with gtk_entry_new() which knows nothing about gtkmm.  I can wrap GtkEntry objects to necessary type (derived from Gtk::Entry.)  Signals then work, but not on_*() methods in C++ object, which are never called.

If GTK+ created entry with a callback (which would amount to gtk_entry_new() by default), gtkmm could tell it to create entries with Entry_Class.  Then C++ inheritance would work automatically, as long as you register necessary wrappers.
Comment 3 Paul Pogonyshev 2006-12-08 20:44:42 UTC
Also it is weird to be a duplicate of a younger bug, I close this one as it is better to have similar bug opened by a GTK+ developer.

*** This bug has been marked as a duplicate of 356864 ***