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 69639 - libglade should handle non GtkWidgets
libglade should handle non GtkWidgets
Status: RESOLVED WONTFIX
Product: libglade
Classification: Deprecated
Component: general
1.99.x
Other All
: Normal enhancement
: libglade-2.2
Assigned To: James Henstridge
James Henstridge
Depends on:
Blocks:
 
 
Reported: 2002-01-25 05:43 UTC by James Henstridge
Modified: 2011-07-19 23:23 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
proposed patch (1.69 KB, patch)
2002-03-03 20:09 UTC, Yanko Kaneti
needs-work Details | Review
patch (4.52 KB, patch)
2006-01-14 12:14 UTC, Johan (not receiving bugmail) Dahlin
none Details | Review

Description James Henstridge 2002-01-25 05:43:41 UTC
(this is based on a suggestion by jrb and andersca)

libglade should be able to work with things other than gtk widgets.  With
the development version, most of the code is simply working with GObject
APIs rather than GtkWidget specific APIs.

Being able to handle things other than GtkWidgets should be quite easy,
although it will most likely involve API additions (which is why it is
probably too late for 2.0).  Here is the basic steps:

  1) remove assertions and assumptions that
     glade_xml_standard_build_widget(), etc are working with GtkWidgets,
     where appropriate, so that they can work with arbitrary GObjects.

  2) Maybe rename functions with widget in their name to indicate that they
     don't just work with widgets.  This would be acompanied with
     compatibility defines, so that programs compiled with the new lib
     use the new functions, and with compatibility functions in the lib
     so that old programs continue to work.

  3) add an <object> tag to the glade file format, that would be treated
     exactly like <widget>.  This would mainly be cosmetic, but it feels
     a bit weird defining non widgets with the <widget> tag.   Handling
     of the new tag would be identical.

Possible uses for this would include:

  - GtkSizeGroups:
      <object class="GtkSizeGroup" id="sizegroup1">
        ...
      </object>
      ...
      <widget id="blah">
        <property name="size-group">sizegroup1</property>
        ...
      </widget>

  - Specifying GnomeCanvasItem objects in a GnomeCanvas widget
      <widget class="GnomeCanvas" id="canvas1">
        <child internal-child="canvas-root">
          <object class="GnomeCanvasGroup" id="group1">
            <child>
              <object class="GnomeCanvasRect" id="rect1">
       ...

  - GtkTreeViewColumn objects in a GtkTreeView widget
  - GtkCellRenderer objects in a GtkTreeViewColumn object

Probably other uses that I haven't thought of yet.

This is almost definitely not 2.0 material though.
Comment 1 James Henstridge 2002-01-31 04:48:57 UTC
Yet another use for this would be working with adjustments.  It would
be one way of hooking a scrollbar up to a text widget, etc.

This is definitely a 2.2 bug now.
Comment 2 Yanko Kaneti 2002-03-03 20:09:21 UTC
Created attachment 6950 [details] [review]
proposed patch
Comment 3 Yanko Kaneti 2002-03-03 20:11:30 UTC
oops, that was a mistake, sorry
Comment 4 Christian Reis (not reading bugmail) 2003-02-07 17:49:42 UTC
It would also allow Kiwi to specify its own widgets for libglade to
build, though not exactly as the proposal above states.
Comment 5 Jonathan Blandford 2003-04-09 13:01:55 UTC
I'm looking into doing this.  The main problem I see is keeping binary
compat.  If we want to do that, we need to either duplicate many
functions with a object variant, or simply keep the names what they
were and modify them to take/return a GObject.  This could cause some
compilation issues, so a gpointer might make more sense.  James, which
would you prefer?  I think I'd rather add object variants for the
functions in glade-xml.h, while just converting GtkWidget to
gpointer/GObject in glade-build.h.  Make sense?
Comment 6 Luis Villa 2004-04-28 04:22:02 UTC
Comment on attachment 6950 [details] [review]
proposed patch

Given that the next comment is 'mistake, sorry' seems it it is safe to mark
this needs-work :)
Comment 7 Johan (not receiving bugmail) Dahlin 2006-01-14 12:14:37 UTC
Created attachment 57339 [details] [review]
patch

Allows GObjects to be registered. Uses weak refs to clean up objects instead of GtkObject::destroy. 

GladeXML's name_hash is now considered being an internal resource and will only be properly free'd when the xml object is finalized.

With this patch it's trivial to support GtkSizeGroups.
Comment 8 Fabio Durán Verdugo 2011-07-19 23:23:12 UTC
The GNOME Release team has officially deprecated libglade in favor of GtkBuilder[1]. So it's unlikely to get further development. I am closing bugs as WONTFIX. Please feel free to reopen the bugs in future if anyone takes the responsibility for active development.

[1] http://permalink.gmane.org/gmane.comp.gnome.devel.announce/28