demo_anchorlayout.py
changeset 71 cfd3445107b4
parent 62 2f61931520c9
child 76 fa5301e58eca
--- a/demo_anchorlayout.py	Sun Jan 27 23:51:59 2013 +0100
+++ b/demo_anchorlayout.py	Wed Jan 30 00:38:48 2013 +0100
@@ -41,6 +41,11 @@
         label_margin.add_handler('draw', self.on_label_margin_draw)
         win.add(label_margin, halign='center', margin=Borders(t=6))
 
+        label_size = Label(str(self.win.sizereq))
+        label_size.name = 'label_size'
+        label_size.add_handler('draw', self.on_label_size_draw)
+        win.add(label_size, halign='center', margin=Borders(t=8))
+
     def on_button_align_click(self, ev):
         align_type = ev.originator.label.split(':', 1)[0]
         align = self.win.hints[align_type]
@@ -52,6 +57,9 @@
     def on_label_margin_draw(self, ev):
         ev.originator.label = str(self.win.hints['margin'])
 
+    def on_label_size_draw(self, ev):
+        ev.originator.label = str(self.win.sizereq)
+
     def on_top_keypress(self, ev):
         if ev.keyname == 'escape':
             self.terminate()