-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Widgets should allow enabled, visible at initialisation #90
Comments
I'm not too sure, I think we shouldn't go overboard with conciseness. A change of state of any widget is very much fit for a method (since methods are supposed to act on the state of classes, yada yada). Soon we'll be implementing all possible events in widget constructors :) |
Mmm, I'm sort of inclined to agree that this might be too much. The reason I didn't bother implementing hide/show etc. at all to begin with is that I wanted to keep things as simple as possible. It's nice to have lots of stuff you can do but for the vast majority of kids and beginner users they won't need to use any of these methods so it might be best to just leave them as methods for more advanced users. I guess my philosophy with guizero is to keep things as simple as possible and not overwhelm people with too much choice! |
Enabled and visible 'feel' like states which should be set at initialisation and enabling the state of components feels like a useful and widely used use-case. A simple app with a Start/Stop (or Connect/Disconnect or Open/Close or Horizontal/Vertical) would want to start with 1 button enabled and 1 disabled. By using defaults the api can be extended offering additional functionality without adding complexity, creating an enabled button is no more complicated than it ever was, whereas you have the option of creating a disabled button at initialisation. enabled_button = PushButton(app, command)
disabled_button = PushButton(app, command, enabled = False) Its clearly not a priority, but its a simple change and adds some functionality. |
Welp, you've convinced me. |
All done except ButtonGroup. These look like they need better/more methods to interact with the individual options
Hi, I've started implementing the enabled=boolean functionality on the widgets as I needed it to make my interface feel move intuitive. I later came across this very issue describing it. I still have to complete it for the ButtonGroup and MenuBar widgets. You have mentioned visibility as well but it is unclear if that functionality is required..? |
I had to add |
resolved in v0.5.0 |
Widgets which can be enabled, disabled, show, hidden should also allow these values to be set at initilisation, e.g.
Instead of:
use
The text was updated successfully, but these errors were encountered: