import sys sys.path.append('/home/dl9pf/user/svn/libyui-bindings/build/bindings/python') import yui #subclass widgetFactory() factory = yui.YUI.widgetFactory() #create main/background Window maindialog = factory.createMainDialog() #vertical alignment # ----------------- # ----------------- mainvbox = factory.createVBox(maindialog) # menu mainmenu_hbox = factory.createHBox(mainvbox) mainmenu_file = factory.createMenuButton(mainmenu_hbox, "Datei") ########################################### # TODO - HOW TO ADD MENUITEMS ?!?!?! # ########################################### #horizontal alignment # ----------------- # | | | # ----------------- mainhbox = factory.createHBox(mainvbox) # create two frames mainframeleft = 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()