FG Spreadshirt Swag
  1. #1

    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.

  2. #2
    The radial menus are built into the client. There is a windowinstance.minimize() API that hasn't been documented yet.

    Regards,
    JPG

  3. #3
    Quote Originally Posted by Moon Wizard View Post
    The radial menus are built into the client. There is a windowinstance.minimize() API that hasn't been documented yet.

    Regards,
    JPG
    Thanks!

  4. #4
    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?

  5. #5
    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

  6. #6
    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...

  7. #7
    Got it!

    Code:
    window.parentcontrol.window.minimize()
    Voila.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
DICE PACKS BUNDLE

Log in

Log in