All pastes #1072275 Raw Edit

libyui/python test

public python v1 · immutable
#1072275 ·published 2008-07-15 11:43 UTC
rendered paste body
import syssys.path.append('/home/dl9pf/user/svn/libyui-bindings/build/bindings/python')import yui#subclass widgetFactory()factory = yui.YUI.widgetFactory()#create main/background Windowmaindialog = factory.createMainDialog()#vertical alignment# -----------------# -----------------mainvbox = factory.createVBox(maindialog)# menumainmenu_hbox = factory.createHBox(mainvbox)mainmenu_file = factory.createMenuButton(mainmenu_hbox, "Datei")############################################ TODO - HOW TO ADD MENUITEMS ?!?!?!      #############################################horizontal alignment# -----------------#  |      |      |# -----------------mainhbox = factory.createHBox(mainvbox)# create two framesmainframeleft = factory.createFrame(mainhbox, "Left")mainframeright = factory.createFrame(mainhbox, "Right")#  | mainframeleft | mainframeright |## -----------------#  | MFL  | MFR  |# -----------------leftselbox = factory.createSelectionBox(mainframeleft, "Hauptmenu")leftselbox.setNotify()leftselbox.addItem("Start")leftselbox.addItem("Netzwerk")leftselbox.addItem("Software")leftselbox.addItem("Xenomai")leftselbox.addItem("Dienste")rightframevbox = factory.createVBox(mainframeright)rightcheckbox = factory.createCheckBox(rightframevbox, "Checkbox1")rightlabel = factory.createLabel(rightframevbox, "Label")rightinputfield = factory.createInputField(rightframevbox, "Inputfield")rightRadioButton1 = factory.createRadioButton(rightframevbox, "1")rightRadioButton2 = factory.createRadioButton(rightframevbox, "2")rightComboBox = factory.createComboBox(rightframevbox, "combobox")rightTree = factory.createTree(rightframevbox, "Tree")rightprogressbar = factory.createProgressBar(rightframevbox, "Progress")# maincancel# -----------------#  | MFL  | MFR  |# -----------------#         [cancel]#mylogview = factory.createLogView(mainvbox, "Log", 4, 10)maincancel = factory.createPushButton(mainvbox, "&Close")while True:    event = maindialog.waitForEvent()    print str(event.toString(event.eventType()))    if not event:        print "empty"        next    if event.eventType() == yui.YEvent.CancelEvent:        maindialog.destroy()        break    if event.widget() == maincancel:        print "yippie"        maindialog.destroy()        break    if event.widget() == leftselbox:        print "selbox"        print leftselbox.selectedItem().label()