Thread: Minimize Window programatically?
-
November 2nd, 2020, 05:08 #1
- Join Date
- Jan 2020
- Posts
- 222
Minimize Window programatically?
Is it possible to minimize a window programatically?
I can't find any calls to any functions with "minimize" in their names in CoreRPG. How does the radial minimize button do it?
Thanks.
-
November 2nd, 2020, 05:44 #2
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,559
The radial menus are built into the client. There is a windowinstance.minimize() API that hasn't been documented yet.
Regards,
JPG
-
November 2nd, 2020, 05:46 #3
-
November 3rd, 2020, 00:11 #4
- Join Date
- Jan 2020
- Posts
- 222
Interesting. Yes, .minimize() is there because I can call it on the image window from inside my toolbar. However, I get the error: "Unable to minimize; only top-level windows can be minimized."
I'm executing from a button in the image toolbar like this:
Code:<toolbar_30 name="toolbar_ztrackpad_minimize" insertbefore="ztrackpad_k1"> <anchored to="toolbar_anchor"> <top /> <right parent="" anchor="right" offset="-10" /> </anchored> <button> <id>z_minimize</id> <icon>zlogo</icon> <tooltipres>z_tooltip_minimize</tooltipres> </button> <script> function onButtonPress(id) if id == "z_minimize" then window.minimize(); end end </script> </toolbar_30>
Thoughts?
-
November 3rd, 2020, 01:06 #5
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,559
That's correct. The toolbar window is not the top level window. You'll need to traverse to the top level window (i.e. "imagewindow" window class) before you can call .minimize().
Regards,
JPG
-
November 3rd, 2020, 04:12 #6
- Join Date
- Jan 2020
- Posts
- 222
I'll have to figure that out. Interesting that window.getImage() gives me the image but window.minimize() isn't the window I need. Time to learn about traversing the windows...
-
November 3rd, 2020, 06:17 #7
- Join Date
- Jan 2020
- Posts
- 222
Got it!
Code:window.parentcontrol.window.minimize()
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks