Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/simple_label.py
diff options
context:
space:
mode:
Diffstat (limited to 'simple_label.py')
-rw-r--r--simple_label.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/simple_label.py b/simple_label.py
new file mode 100644
index 0000000..1196aac
--- /dev/null
+++ b/simple_label.py
@@ -0,0 +1,25 @@
+from gi.repository import Gtk
+
+LONG_TEXT = 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit, ' \
+ 'sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna ' \
+ 'sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna ' \
+ 'sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna ' \
+ 'sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna ' \
+ ' liquam erat volutpat. Ut wisi enim ad minim veniam'
+
+win = Gtk.Window()
+box = Gtk.VBox()
+
+align = Gtk.Alignment.new(0.5, 0.5, 0, 0)
+label = Gtk.Label(LONG_TEXT)
+label.set_max_width_chars(40)
+label.set_single_line_mode(False)
+label.set_line_wrap(True)
+
+align.add(label)
+box.add(align)
+win.add(box)
+
+win.connect("delete-event", Gtk.main_quit)
+win.show_all()
+Gtk.main()