Created attachment 416728 [details]
Test script to show DeprecationWarning
Description of problem:
I have a code which tries to prevent line wrap by calling
on RHEL 6, and pygtk2 (?) complains about the call being deprecated. Using set_property does not help either.
Colleagues at #desktop say that it is not marked as deprecated in C API, so I believe it should not be in python either.
Version-Release number of selected component (if applicable):
# rpm -q pygtk2
Steps to Reproduce:
1. Run the attached script with python.
/tmp/test_wrap.py:11: DeprecationWarning: use set_markup() instead
/tmp/test_wrap.py:12: DeprecationWarning: use set_markup() instead
I can avoid the set_use_markup by using
--- /tmp/test_wrap.py.orig 2010-05-26 11:31:27.581399590 +0200
+++ /tmp/test_wrap.py 2010-05-26 11:31:40.452312105 +0200
@@ -7,9 +7,9 @@
is not reflowed, so every even line is very short because it just has those ends.
-dialog = gtk.MessageDialog(None, 0, gtk.MESSAGE_WARNING, gtk.BUTTONS_OK, text)
+dialog = gtk.MessageDialog(None, 0, gtk.MESSAGE_WARNING, gtk.BUTTONS_OK)
(is that equivalent?) but what do I use instead of that set_line_wrap if I wanted to get rid of that call?
The deprecation warning is coming from your accessing "dialog.label", which is supposed to be private. See https://bugzilla.gnome.org/show_bug.cgi?id=309180.
GtkMessageDialog is rather restrictive in what it will let you do with the labels. You would probably be better off constructing an equivalent window out of GtkDialog, where you'd have full access to the label.
Closing this as NOTABUG since the deprecation is intentional.
Alright. How do I achieve the set_line_wrap equivalent then?
As I said, build your own GtkDialog.