[yast-devel] libyui python-bindings
Hello hackers! I'm working on "something" in python using libyui. Everything seems ok, but I don't know how to create tabs. Using this doc: http://forgeftp.novell.com//yast/doc/SL11.0/tdg/DumbTab_widget.html but I don't know how to write it in python.
import yui factory = yui.YUI.widgetFactory() But there is no factory.createDumbTab() method. I can grep "createDumbTab" string in http://svn.opensuse.org/svn/yast/trunk/libyui-bindings/swig/python , but I don't understand swig.
Thank you, Michal -- Best Regards, Michal Zugec Software developer --------------------------------------------------------------------- SuSE CR, s.r.o. e-mail: mzugec@suse.cz Lihovarska 1060/12 tel: +420 284 028 960 190 00 Praha 9 fax: +420 296 542 374 Czech Republic http://www.suse.cz/ -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org
* Michal Zugec
Hello hackers!
I'm working on "something" in python using libyui. Everything seems ok, but I don't know how to create tabs. Using this doc: http://forgeftp.novell.com//yast/doc/SL11.0/tdg/DumbTab_widget.html but I don't know how to write it in python.
import yui factory = yui.YUI.widgetFactory() But there is no factory.createDumbTab() method.
Its hidden inside optionalWidgetFactory because you need to check for its presence first, see libyui/src/YOptionalWidgetFactory.h So one needs to create the optional factory besides the main factory: factory = yui.YUI.widgetFactory() optional = yui.YUI.optionalWidgetFactory() Then create a dialog, check for DumpTab and create DumpTab, e.g.: dialog = factory.createPopupDialog() vbox = factory.createVBox( dialog ) if optional.hasDumbTab(): dumptab = optional.createDumbTab( vbox ) dumptab.addItem( yui.YItem("Page 1") ) ... I am currently trying to convert the "Minimalistic example for tab widget" (from the forgeftp yast docs) to Python but still get core dumps. See swig/python/examples/tabwidget.py. Klaus -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org
On Montag, 5. Januar 2009, Klaus Kaempf wrote:
Its hidden inside optionalWidgetFactory because you need to check for its presence first, see libyui/src/YOptionalWidgetFactory.h
...but in the meantime YDumbTab is available for all UIs (ncurses, too), so it
will go to YWidgetFactory soon. It's on my to-do list.
So theoretically, yes, you still have to ask the YOptionalWidgetFactory if
that widget class is available and have a fallback strategy if it isn't. But
for all practical purposes, you can safely assume that it is available and
forget about a fallback strategy.
CU
--
Stefan Hundhammer
participants (3)
-
Klaus Kaempf
-
Michal Zugec
-
Stefan Hundhammer