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 328069 - Make GtkMessageDialog a GtkBuildable to access the message_area
Make GtkMessageDialog a GtkBuildable to access the message_area
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
unspecified
Other All
: Normal enhancement
: ---
Assigned To: gtk-bugs
gtk-bugs
: 586062 (view as bug list)
Depends on:
Blocks: 586062 586731 595791 597610 612712
 
 
Reported: 2006-01-21 20:45 UTC by Christian Persch
Modified: 2011-02-04 16:12 UTC
See Also:
GNOME target: 3.0
GNOME version: ---



Description Christian Persch 2006-01-21 20:45:14 UTC
GtkMessageDialog makes a good base for a HIG message dialogue, but sometimes you want to add a bit of UI, like for example a checkbox. But you don't want it like this:
[Image] [Primary + Secondary labels]
[Checkbox]

but instead like this:
[Image] [Labels]
        [Checkbox]

To do that, you need to access the correct gtkvbox to pack the checkbox into. You can get it with a bit of digging into the internals (child of child of dialog->vbox), but that adds a dependency on the exact implementation details. I'd prefer there to be a public accessor for it.

If you agree, I can provide a patch.
Comment 1 Christian Dywan 2008-10-06 17:35:20 UTC
It should be nice to be able to extend message dialogues, however I would wonder how far that conflicts with GtkDialog. ie. having gtk_dialog_get_content_area and gtk_message_dialog_get_message_area would be rather confusing.
Comment 2 Christian Persch 2009-06-17 13:44:05 UTC
And this content box should also be exposed to gtkbuilder as an internal child, so one can add content to it from builder files (bug 586062).
Comment 3 Christian Persch 2010-06-20 17:55:19 UTC
About comment 2: how about making adding a vfunc in GtkDialogClass which gtk_dialog_get_content_area calls? Then GtkMessageDialog would override this vfunc to return the inner content box instead of the usual outer one; and this would automatically make this work with gtkbuilder too.
Comment 4 Federico Mena Quintero 2010-06-22 18:17:43 UTC
(In reply to comment #3)
> About comment 2: how about making adding a vfunc in GtkDialogClass which
> gtk_dialog_get_content_area calls? Then GtkMessageDialog would override this
> vfunc to return the inner content box instead of the usual outer one; and this
> would automatically make this work with gtkbuilder too.

This is interesting, but it would no longer let you actually access the dialog's main vbox (and you would have to go digging in the widget hierarchy all over again).

I've just pushed a gtk_message_dialog_get_message_area() function.  Making it a GtkBuildable is left as an exercise for the reader, as I really need to go to the toilet and my laptop gets too warm to hack this while sitting down.

I said SITTING.
Comment 5 Federico Mena Quintero 2010-06-22 18:19:08 UTC
*** Bug 586062 has been marked as a duplicate of this bug. ***
Comment 6 Matthias Clasen 2010-06-22 18:25:20 UTC
I was not in favor of doing that, actually.
Comment 7 Federico Mena Quintero 2010-06-22 18:32:57 UTC
Sorry.  When you gotta go, you gotta go.