[yast-commit] r54361 - /trunk/libyui-bindings/swig/python/examples/tabwidget.py
Author: kkaempf Date: Mon Jan 5 12:33:32 2009 New Revision: 54361 URL: http://svn.opensuse.org/viewcvs/yast?rev=54361&view=rev Log: minimalistic tab widget example, does not work yet ! :-( Added: trunk/libyui-bindings/swig/python/examples/tabwidget.py Added: trunk/libyui-bindings/swig/python/examples/tabwidget.py URL: http://svn.opensuse.org/viewcvs/yast/trunk/libyui-bindings/swig/python/examples/tabwidget.py?rev=54361&view=auto ============================================================================== --- trunk/libyui-bindings/swig/python/examples/tabwidget.py (added) +++ trunk/libyui-bindings/swig/python/examples/tabwidget.py Mon Jan 5 12:33:32 2009 @@ -0,0 +1,51 @@ + +#!/usr/bin/env python +# +# tabwidget.py +# Minimalistic example for tab widget +# (http://forgeftp.novell.com//yast/doc/SL11.0/tdg/DumbTab_widget.html) + +import sys +sys.path.insert(0,'../../../build/swig/python') +import yui + + +#if ( ! UI::HasSpecialWidget(`DumbTab ) ) +# UI::OpenDialog( +# `VBox( +# `Label("Error: This UI doesn't support the DumbTab widget!"), +# `PushButton(`opt(`default), "&OK") +# ) +# ); +# UI::UserInput(); +# UI::CloseDialog(); +# +# return; +# } + + +factory = yui.YUI.widgetFactory() +optional = yui.YUI.optionalWidgetFactory() +dialog = factory.createPopupDialog() + +vbox = factory.createVBox( dialog ) +if optional.hasDumbTab(): + dumptab = optional.createDumbTab( vbox ) + dumptab.addItem( yui.YItem("Page 1") ) + dumptab.addItem( yui.YItem("Page 2") ) + dumptab.addItem( yui.YItem("Page 3") ) +else: + factory.createLabel(vbox, "Error: This UI doesn't support the DumbTab widget!") + +factory.createPushButton( vbox, "&Close" ) +event = dialog.waitForEvent() +dialog.destroy() + +# `VBox( +# `DumbTab( +# [ "Page 1", "Page 2", "Page 3" ], +# `RichText(`id(`contents), "Contents" ) +# ), +# `Right(`PushButton(`id(`close), "&Close" ) ) +# ) +# ); -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
kkaempf@svn.opensuse.org