-
Notifications
You must be signed in to change notification settings - Fork 739
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
Add the argument bounds to the .scope and .plotTree methods to define their bounds; add the argument position to the .meter method to define its position #6230
Conversation
documentation update for the method .scope to define the location of scope window
documentation update for the method .scope to define the scope window location
update .scope method to locate scope window position
Typically a window widget would accept a |
@mtmccrea I also found a problem. I should fix this. |
added variables to have a singleton plotTreeWindow and a singleton scopeWindowDefined
changed position argument in scope method to bounds
The position arguments for the server scope method and the function scope method are changed to bounds. And the server scope is changed so that it displays only one scope and works fine when users use manually assigned bounds and the default bound value of nil in succession.
has been modified to show only one boundary and to work fine when users are using manually assigned bounds and the default boundary value of nil, one after the other. Also, pressing m will change its size based on user-defined bounds, if any.
position argument for scope method is changed to bounds, so the documentation is updated
@mtmccrea I also did the same for Server plotTree and Server meter. However, I am not sure if I should upload these changes here or make two other separate PRs. |
added bounds argument to the method `.plotTree`
documentation update for the added argument `bounds` for the method `.plotTree`
The The size of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea is reasonable, please add the documentation.
added point to define the server meter position.
documentation update for the added position argument for .meter method.
Something to consider: what would the code look like to change the bounds of the GUI without the new argument? |
spaces within curly brackets are added
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
The behaviour of resizing has been corrected. It now retains the position as before if the new width and height do not exceed the screen boundary. If the new height exceeds the screen boundary, the vertical point is modified so that it does not exceed the screen boundary. If the new width exceeds the screen boundary, then the horizontal point is modified so that it does not exceed the screen boundary.
This comment was marked as resolved.
This comment was marked as resolved.
Now there are three options to change the boundary of scope window:
@mtmccrea @telephone However, if you think that adding my modification to |
added bounds for scope argument for Bus
Also added the |
bounds = nil in arg -> bounds
position = nil in arg -> position
Thanks for your patience on this @prko.
My hesitation about adding these as arguments to the creation methods is that I could image more features being added to these UIs in the future, which may require arguments more closely related to their functionality, as opposed to generic view parameters, which can be accessed through the the methods you found above. I think a good middle ground may be to add a new This has the added benefit that no change would be needed to the to I did a quick implementation of bounds_ { arg rect;
if( window.notNil ) { window.bounds_(rect.asRect) };
} So to add to the list of calls you found: s.scope.window.bounds_(Rect(100, 100, 400, 400)) // current
s.scope.view.bounds_(Rect(100, 100, 400, 400)) // current
s.scope(bounds: Rect(100, 100, 400, 400)) // proposed in this PR
s.scope.bounds_(Rect(100, 100, 400, 400)) // suggested What do you think? |
Ah, I didn't see that @telephon had started a review... I'm happy to defer to the review on whether my suggestion should be considered. I don't mean to hold up a review that's underway. |
Wow! For me, the way you suggested is better to read:
I think @mtmccrea's suggestion could also be applied to I will wait for @telephon's reply. @mtmccrea and @telephon. Please tell me what to do:
|
With a quick look at all these methods, I see that their internal handling of the created Window is different between them, so the solution won't be the same for each. It's good to have a consistent approach to setting bounds across all server-related GUIs, but this may not be possible. In general, we try to avoid adding new arguments if the solution can be achieved through method calls that are just as concise. The |
@mtmccrea
Then I will add the Then I will open two new PRs:
However, to create two new PRs, What do you think of this idea? |
Function:-scope // this returns a Synth
Server:-plotTree // this returns a Server
And to clarify:
The reason you don't want to do this is because bounds are not a property, either literally or conceptually, of I hope I've summarized your goals for these changes accurately! Let me know if I've misunderstood any of your intentions. And these are just my thoughts, others may have a better way of making all this fit together :) |
I removed almost all changes except for this scope window resize behaviour, and added |
Oh, sorry! Because I changed the name of the connected branch to this PR, the PR is closed and I can connect this PR and the renamed one. I will open a new PR. Sorry, I am still a beginner in this kind of work.... |
@mtmccrea I think I have done everything you mentioned. I just hope my activation is helpful for the development of SC. |
Purpose and Motivation
.scope
has no argument to define its window location. Often it is good to see this window on the centre of the screen, but sometimes it is not so optical.This modification adds one more argument for this feature. Thus, the following code is available (I intentionally paste all code to present the necessity of this feature):
demo video:
https://www.dropbox.com/scl/fi/qj0337im08mqyzcj2k4fx/Screen-Recording-2024-03-06-at-14.03.44.mov?rlkey=k82z5kwoi2w0nj23sy56nfxht&dl=0
Types of changes
To-do list