Mailinglist Archive: yast-devel (77 mails)

< Previous Next >
Re: [yast-devel] libyui python-bindings
  • From: Klaus Kaempf <kkaempf@xxxxxxx>
  • Date: Mon, 5 Jan 2009 12:34:31 +0100
  • Message-id: <20090105113431.GA5061@xxxxxxxxxxxxx>
* Michal Zugec <mzugec@xxxxxxx> [Jan 04. 2009 15:35]:
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@xxxxxxxxxxxx
For additional commands, e-mail: yast-devel+help@xxxxxxxxxxxx

< Previous Next >
List Navigation
Follow Ups
References