* Michal Zugec <[email protected]> [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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to