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 160264 - GtkFileChooserDialog internal children are not built correctly
GtkFileChooserDialog internal children are not built correctly
Status: RESOLVED FIXED
Product: libglade
Classification: Deprecated
Component: general
2.0.x
Other Linux
: Normal major
: ---
Assigned To: James Henstridge
James Henstridge
Depends on:
Blocks:
 
 
Reported: 2004-12-02 21:05 UTC by Vesa Halttunen
Modified: 2005-02-12 01:17 UTC
See Also:
GNOME target: ---
GNOME version: 2.7/2.8


Attachments
Patch to fix the problem (645 bytes, patch)
2004-12-02 21:05 UTC, Vesa Halttunen
none Details | Review
Simple test code and glade file to exhibit the existence of this problem (1.58 KB, application/x-tar)
2005-01-28 20:26 UTC, Vesa Halttunen
  Details

Description Vesa Halttunen 2004-12-02 21:05:20 UTC
1. Create a GtkFileChooserDialog using Glade 2.6.7
2. Save the GUI as a GLADE file
3. Load the GLADE file using libglade 2.4.1
4. Notice that the Open/Cancel buttons are missing

This happens because GtkFileChooserDialog is registered as follows in libglade
2.4.1 (glade-gtk.c, line 1236):

    glade_register_widget (GTK_TYPE_FILE_CHOOSER_DIALOG,
glade_standard_build_widget,
			   NULL, NULL);

Note the NULLs: internal children are not handled at all.

To fix this this should be changed to:

    glade_register_widget (GTK_TYPE_FILE_CHOOSER_DIALOG,
glade_standard_build_widget,
			   gtk_dialog_build_children, dialog_find_internal_child);

I'm not sure if gtk_dialog_build_children is completely appropriate for file
chooser dialogs as well but at least it seems to work. Someone with more
knowledge about libglade internals should verify this...
Comment 1 Vesa Halttunen 2004-12-02 21:05:56 UTC
Created attachment 34420 [details] [review]
Patch to fix the problem
Comment 2 James Henstridge 2004-12-05 18:18:05 UTC
*** Bug 155200 has been marked as a duplicate of this bug. ***
Comment 3 Vesa Halttunen 2005-01-03 17:00:00 UTC
Does this bug need additional information? I'm waiting for a libglade release
with a fix for this before I release a version of my program that uses
GtkFileChooserDialogs using libglade.
Comment 4 Loïc Minier 2005-01-21 08:42:27 UTC
(This has been reported in Debian too, see <http://bugs.debian.org/291508>.)
Comment 5 Vesa Halttunen 2005-01-28 20:26:07 UTC
Created attachment 36666 [details]
Simple test code and glade file to exhibit the existence of this problem

Here's a simple program that shows the nature of the problem without any
effort. The package contains a Makefile that builds a simple source which will
load the supplied .glade file with only one widget - a file chooser dialog. The
file chooser dialog will not have Open/Cancel buttons in it. You can quit the
program by closing the file chooser dialog window.

To run:

tar jxf gladetest.tar.bz2
cd gladetest
make
./gladetest

You can then apply the patch attached to this bug report and try the program
again. The Cancel/Open buttons should appear.
Comment 6 Vesa Halttunen 2005-01-28 20:30:17 UTC
To make things clear: attachment 36666 [details] is a .tar.bz2 archive.
Comment 7 Luis Villa 2005-01-28 20:50:33 UTC
Given the dup, marking up. Vesa, you might want to email to the glade-devel
list- I know that the bugzilla is not very well looked after, unfortunately.
Comment 8 James Henstridge 2005-02-12 01:17:41 UTC
Thanks for the patch.  I've applied it and put out a new release.  Sorry about
not handling it sooner.