GNOME Bugzilla – Bug 311254
GtkMessageDialog::message
Last modified: 2011-02-04 16:10:23 UTC
We have some problems binding GtkMessageDialog in python since the message_format variable is not possible to set as a propertly.
Setting the message_format as a property doesn't seem interesting unless you could also set the format *arguments* as a property, and that isn't conceivably possible. The varargs constructors are just convenience ... you can write similar convenience in Python, or you could just assume that it isn't necessary because people can just use '%'.
Sorry for being unclear, I did not propose adding a message_format property. What I meant was to add message property which maps to the text of the label, which is currently private. The construct could then be modified to set the text of the label (after formatting the varargs) through g_object_new.
Also a 'flags' constructor property would be required if we want to avoid copy-pasting code from gtk+ into pygtk.
BTW, if I posted a patch today, would this catch the gtk+ 2.8 train, or there is no time?
No, 2.10 at this point
OK, just checking... :)
Nevermind the flags. They're completely redundant.
Created attachment 54050 [details] [review] patch
*** Bug 100488 has been marked as a duplicate of this bug. ***
We probably need 4 properties, text, text_use_markup, secondart_text, secondary_text_use_markup to cover all combinations. Also see bug 100488.
Created attachment 57128 [details] [review] untested patch
Created attachment 57142 [details] [review] tested patch The new patch correctly handles changes of the properties correctly.
One thing I missed is "Since: 2.10" markers for the new properties.
Slightly offtopic, gtk/gtkmessagedialog.c, function gtk_message_dialog_new has: --------------- if (flags & GTK_DIALOG_NO_SEPARATOR) { g_warning ("The GTK_DIALOG_NO_SEPARATOR flag cannot be used for GtkMessageDialog"); flags &= ~GTK_DIALOG_NO_SEPARATOR; } [...] if (flags & GTK_DIALOG_NO_SEPARATOR) gtk_dialog_set_has_separator (dialog, FALSE); --------------- The last bit seems redundant. Probably some leftover code..
Comment on attachment 57142 [details] [review] tested patch Looks pretty good yes. It seems like it'd be easier to integrate it into UI designers. (Which I think was what I originally meant)
2006-01-11 Matthias Clasen <mclasen@redhat.com> * gtk/gtkmessagedialog.c: Add properties. (#311254, Johan Dahlin) (gtk_message_dialog_new): Remove some redundant code, pointed out by Gustavo Carneiro.