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 311254 - GtkMessageDialog::message
GtkMessageDialog::message
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
2.7.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
: 100488 (view as bug list)
Depends on:
Blocks: 312056
 
 
Reported: 2005-07-22 12:47 UTC by Johan (not receiving bugmail) Dahlin
Modified: 2011-02-04 16:10 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (1.93 KB, patch)
2005-10-29 16:44 UTC, Gustavo Carneiro
none Details | Review
untested patch (5.05 KB, patch)
2006-01-10 22:04 UTC, Matthias Clasen
none Details | Review
tested patch (5.85 KB, patch)
2006-01-11 05:42 UTC, Matthias Clasen
none Details | Review

Description Johan (not receiving bugmail) Dahlin 2005-07-22 12:47:31 UTC
We have some problems binding GtkMessageDialog in python since the
message_format variable is not possible to set as a propertly.
Comment 1 Owen Taylor 2005-07-22 13:45:06 UTC
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 '%'.
Comment 2 Johan (not receiving bugmail) Dahlin 2005-07-22 14:01:56 UTC
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.

Comment 3 Gustavo Carneiro 2005-07-22 14:19:57 UTC
Also a 'flags' constructor property would be required if we want to avoid
copy-pasting code from gtk+ into pygtk.
Comment 4 Gustavo Carneiro 2005-07-22 15:57:53 UTC
BTW, if I posted a patch today, would this catch the gtk+ 2.8 train, or there is
no time?
Comment 5 Matthias Clasen 2005-07-22 16:32:22 UTC
No, 2.10 at this point
Comment 6 Gustavo Carneiro 2005-07-22 16:40:20 UTC
OK, just checking... :)
Comment 7 Gustavo Carneiro 2005-10-29 16:26:48 UTC
Nevermind the flags.  They're completely redundant.
Comment 8 Gustavo Carneiro 2005-10-29 16:44:32 UTC
Created attachment 54050 [details] [review]
patch
Comment 9 Matthias Clasen 2006-01-09 20:35:07 UTC
*** Bug 100488 has been marked as a duplicate of this bug. ***
Comment 10 Matthias Clasen 2006-01-09 20:36:39 UTC
We probably need 4 properties, 

text, text_use_markup,
secondart_text, secondary_text_use_markup

to cover all combinations. Also see bug 100488.
Comment 11 Matthias Clasen 2006-01-10 22:04:58 UTC
Created attachment 57128 [details] [review]
untested patch
Comment 12 Matthias Clasen 2006-01-11 05:42:31 UTC
Created attachment 57142 [details] [review]
tested patch

The new patch correctly handles changes of the properties correctly.
Comment 13 Matthias Clasen 2006-01-11 05:45:04 UTC
One thing I missed is "Since: 2.10" markers for the new properties. 
Comment 14 Gustavo Carneiro 2006-01-11 14:54:40 UTC
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 15 Johan (not receiving bugmail) Dahlin 2006-01-11 15:01:34 UTC
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)
Comment 16 Matthias Clasen 2006-01-11 15:30:32 UTC
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.