GNOME Bugzilla – Bug 328069
Make GtkMessageDialog a GtkBuildable to access the message_area
Last modified: 2011-02-04 16:12:18 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.
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.
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).
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.
(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.
*** Bug 586062 has been marked as a duplicate of this bug. ***
I was not in favor of doing that, actually.
Sorry. When you gotta go, you gotta go.