source: orange/orange/doc/extend-widgets/gui_spin.py @ 9398:a6b3d9c13ee0

Revision 9398:a6b3d9c13ee0, 1.2 KB checked in by mitar, 2 years ago (diff)

Renaming documentation for widgets developers.

Line 
1from OWWidget import *
2import OWGUI
3
4class Test(OWWidget):
5   
6    settingsList = ["spinval", "alpha", "beta"]
7    def __init__(self, parent=None):
8        OWWidget.__init__(self, parent, 'Spin')
9       
10        # GUI
11        self.spinval = 10
12        OWGUI.spin(self.controlArea, self, "spinval", 0, 100, box="Value A")
13        box = OWGUI.widgetBox(self.controlArea, "Options")
14        self.alpha = 30
15        self.beta = 4
16        OWGUI.spin(box, self, "alpha", 0, 100, label="Alpha:", labelWidth=60,
17                   orientation="horizontal", callback=self.setInfo)
18        OWGUI.spin(box, self, "beta", -10, 10, label="Beta:", labelWidth=60,
19                   orientation="horizontal", callback=self.setInfo)
20
21        box = OWGUI.widgetBox(self.controlArea, "Info")
22        self.info = OWGUI.widgetLabel(box, "")
23        self.setInfo()
24       
25        self.resize(100,50)
26
27    def setInfo(self):
28        self.info.setText("Alpha=%d, Beta=%d" % (self.alpha, self.beta))
29
30##############################################################################
31# Test the widget, run from prompt
32
33if __name__=="__main__":
34    appl = QApplication(sys.argv)
35    ow = Test()
36    ow.show()
37    appl.exec_()
Note: See TracBrowser for help on using the repository browser.