rawpython / remi

Python REMote Interface library. Platform independent. In about 100 Kbytes, perfect for your diet.
Apache License 2.0
3.48k stars 401 forks source link

Can I group widgets and enable/disable them by only one operation? #439

Closed occoder closed 3 years ago

occoder commented 3 years ago

I got quite a few widgets (e.g. spin) that need to be enabled or disabled in sync. Should I have to enable/disable individual widget one by one? Or maybe I can group them and just operate once on such group? Thanks in advance.

dddomodossola commented 3 years ago

Heĺlo @occoder , it is ok to disable groups of widgets ;-)

occoder commented 3 years ago

Heĺlo @occoder , it is ok to disable groups of widgets ;-)

Should I wrap all widgets into a container and operate on that container?

dddomodossola commented 3 years ago

@occoder yes it is simpler to do this way

occoder commented 3 years ago

@occoder yes it is simpler to do this way

@dddomodossola I did wrap these widgets into a HBox container and tried to enable/disable the HBox object. But it turned out that the individual spin widget is NOT grayed out if its parent HBox container is disabled. I don't know what could possibly go wrong?

dddomodossola commented 3 years ago

Which remi version are you using? I suggest you to update to the latest version and refresh the browser cache.

occoder commented 3 years ago

@dddomodossola I used the latest version, i.e. 2021.3.2. I found that xxx_hbox.set_enabled(False) does not gray out the HBox container. And this #373 indicates that container could (only?) be disabled through a workaround method like

mycontainer.style['pointer-events'] = 'none'
mycontainer.style['opacity'] = '0.4' #this is to give a disabled apparence

and re-enabled through del mycontainer.style['pointer-events'] Is this still the situation in the latest version of Remi?

dddomodossola commented 3 years ago

@occoder Maybe there is a problem in the css. I will fix it soon.

dddomodossola commented 3 years ago

@occoder I pushed a bugfix to the master branch. You should install remi from master branch and eventually refresh your cache.