Author: kkaempf
Date: Tue Aug 5 17:37:21 2008
New Revision: 49730
URL: http://svn.opensuse.org/viewcvs/yast?rev=49730&view=rev
Log:
example for replacepoints
Added:
trunk/libyui-bindings/swig/python/examples/replacepoint.py
Added: trunk/libyui-bindings/swig/python/examples/replacepoint.py
URL: http://svn.opensuse.org/viewcvs/yast/trunk/libyui-bindings/swig/python/examples/replacepoint.py?rev=49730&view=auto
==============================================================================
--- trunk/libyui-bindings/swig/python/examples/replacepoint.py (added)
+++ trunk/libyui-bindings/swig/python/examples/replacepoint.py Tue Aug 5 17:37:21 2008
@@ -0,0 +1,27 @@
+# coding=UTF-8
+#
+# Replacepoint, allows you to replace part of the widget tree
+#
+# Example by Jan-Simon Möller
+#
+
+import sys
+sys.path.insert(0,'../../../build/bindings/python')
+import yui
+
+factory = yui.YUI.widgetFactory()
+dialog = factory.createMainDialog()
+replacepoint = factory.createReplacePoint(dialog)
+hbox = factory.createHBox(replacepoint)
+b1 = factory.createPushButton(hbox, "1")
+b2 = factory.createPushButton(hbox, "2")
+b3 = factory.createPushButton(hbox, "3")
+event = dialog.waitForEvent() # push button
+replacepoint.deleteChildren()
+vbox = factory.createVBox(replacepoint)
+b1 = factory.createPushButton(vbox, "1")
+b2 = factory.createPushButton(vbox, "2")
+b3 = factory.createPushButton(vbox, "3")
+dialog.recalcLayout()
+replacepoint.showChild()
+event = dialog.waitForEvent() # tada!
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org