-
-
Notifications
You must be signed in to change notification settings - Fork 671
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
Window maximize & minimize API functionality #1857
Comments
@freakboy3742 is there any interest in having something like this in Toga, or is it out of scope? |
We already have an API for As for the exact shape of the API - although min/max/fullscreen are mutually exclusive, On that basis, my suggestion would be I can see the idea behind a |
I also think For the windows platform implementation though, it would be less code going for a "state" type of system as thats what Winforms is using (see my example above). Does MacOS & Linux do something similar? If they do, perhaps the |
^ If above sounds good to you I can start working on a PR for https://github.com/beeware/toga/blob/main/core/src/toga/window.py & https://github.com/beeware/toga/blob/main/winforms/src/toga_winforms/window.py . Unfortunately Im not familiar with developing for other platforms. |
I should mention btw that one could use string literals to provide code editor auto completion for string literals, I came across this comment recently: zauberzeug/nicegui#117 (comment) , not saying we should use it, but just in case you never seen that before |
That would be my thought as well.
To be clear "less code" is a desirable goal; but when when faced with "more implementation code" and "simpler user-facing interface", we're going to opt for "simpler user-facing interface" every time. In terms of what other macOS and GTK do:
So - GTK property details notwithstanding, on those platforms implementing direct That said, from a conceptual point of view, a window can only assume a single value - so it makes some sense that it can be retrieved by a single property. My only objection is the term "state"... but GTK and Winforms explicit use the term "state" to describe min/max, and macOS talks about "Zoomed state", "standard state", "miniaturized state", ... so maybe "state" isn't such a bad term after all. It's worth noting that a |
Type-annotation based discovery is a nice trick, but it's still misleading. The state isn't a string - it's using a string as a token. If you want to use a token, you should be using an constant - and if there are constant values, they should be defined in an enum. |
That's fine - you don't need to provide a full implementation for all platforms. However, you do need to provide a stub for all platforms that logs a "not implemented" message so that anyone using the platform knows why an API isn't working. |
What is the problem or limitation you are having?
I would like to be able to maximize & minimize toga windows programmatically on desktop platforms
Describe the solution you'd like
I believe the maintainers of this repo probably knows better what the API for this would look like, but perhaps something like:
or:
Im not very picky about the implementation details.
Heres a simple demonstration of the sort of behavior I'm after:
https://youtu.be/zB-f6CAmww8
Describe alternatives you've considered
Not sure if this would be implementable on all desktop platforms
Additional context
No response
The text was updated successfully, but these errors were encountered: