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 787546 - gtkbuilder: should allow values of type GType
gtkbuilder: should allow values of type GType
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Class: GtkBuilder
3.22.x
Other Linux
: Normal normal
: ---
Assigned To: GtkBuilder maintainers
GtkBuilder maintainers
Depends on:
Blocks:
 
 
Reported: 2017-09-11 12:27 UTC by Nubosch
Modified: 2018-05-02 19:05 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
code snipped allowing GType values (931 bytes, text/plain)
2017-09-11 12:27 UTC, Nubosch
Details

Description Nubosch 2017-09-11 12:27:52 UTC
Created attachment 359524 [details]
code snipped allowing GType values

parsing GType values allows e.g. objects with GType properties or GtkListStore with GType column.  

this would get rid of error "Unsupported GType 'GType'"

I can get it working on my system using the attached snipped which looks like a naive hack to me. I assume this is not true on all systems?

g_assert(G_TYPE_FUNDAMENTAL(G_TYPE_GTYPE) == G_TYPE_POINTER);

Maybe someone can point out a fancy #ifdef, the correct approach or give me a hint why this is a bad idea at all.
Comment 1 Matthias Clasen 2017-10-07 22:33:03 UTC
What is the use case for specfying a column of type GType ? Seems a bit specialized to me...
Comment 2 Nubosch 2017-10-08 14:08:37 UTC
Yes indeed this may be a bit specialized. First of all I was surprised by the funny error message, that was what got me interested.

I can imagine any kind of factory use case, creating widgets according to a given type.

Maybe something like a "navigation link" class with a GType property constructing pages/panels on the fly. 

Or data tuples requiring a special class to be processed which can be created on the fly with this, allowing the class to be part of the tuple.

I'm pretty sure everything can be achieved on other ways. If not in a totally different approach at least by storing the type as string and resolving it manually. My thought was it would be more elegant, maybe I'm wrong.

The first question I tried to answer was, maybe for educational reasons, what would it take to allow this, and which impact has it on the existing code base.
Comment 3 GNOME Infrastructure Team 2018-05-02 19:05:05 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gtk/issues/907.