Orange Forum • View topic - Erratic UI behaviour at ows loading

Erratic UI behaviour at ows loading

Report bugs (or imagined bugs).
(Archived/read-only, please use our ticketing system for reporting bugs and their discussion.)
Forum rules
Archived/read-only, please use our ticketing system for reporting bugs and their discussion.

Erratic UI behaviour at ows loading

Postby assela » Fri Feb 22, 2008 20:59

Hi all,

Look at the following code for a simple Orange Widget. I observe the following behavior. (First guess is I have done something wrong..)

--To reproduce--
a. Create a new widget folder and copy the code into a file in it.
b. Run Orange canvas and create two instances of the component.
c. change the lineedit content of each instance to a distinct value (say x1 and x2)
c. Save the 'model' as ows
d. Quit
e. Open orange again and load ows file
--(imagined?) bug--
f. the value in both lineedits would be same!!
g. now click on button (test value), it will show that pickled instances has loaded ( correctly. But the UI (lineedit) values are not updated.
h. The moment the values in the lineedit are edited, that edit will be reflected in the value (do it and check after that by clicking the button).

When OWGUI is given a value in a constituent object, at loading of ows file the communication from value->UI is broken, but UI->value works!!

<name>Default WSS Component</name>
<description>Use this only when there is no specific component available.</description>
from OWWidget import *
from orange import *
import OWGUI

class OWWSComponent(OWWidget):
settingsList = ['myWSComponent']
def __init__(self, parent=None, signalManager=None,_myWSComponent=None):
OWWidget.__init__(self,parent, signalManager, 'WSComponent-generic')

if _myWSComponent==None :

# GUI = QVGroupBox("", self.controlArea)
self.tmp2=OWGUI.button(,self,"test value",

def click(self):

def process_data(self,data):

class WSComponent:
"""Parent class for all WS compoents"""
def __init__(self, name, dumb): = name

def __getstate__(self):
print "saving my state : ",
return []
def __setstate__(self,state):
print "loading my state : ",

A work around?

Postby assela » Fri Feb 22, 2008 22:57

If you add the following to the widget class, then things are ok. But is this the intended behavior:

def activateLoadedSettings(self):
#don't know why, but this is necessary to get GUI sync with value object
#after loading ows file.

Postby Gregor Leban » Mon Feb 25, 2008 14:22

Hi Assela,

the behaviour that you get is not a bug. In the settingsList you specified myWSComponent, which is actually a class instance. If you want to make you widget work as desired, simply change:

settingsList = ['myWSComponent']


settingsList = ['']


Return to Bugs