Command-M? Command-W?

Using Standalone Maker to build executables or delivering projects for use with the SuperCard Player? Discuss it here.

Command-M? Command-W?

Postby drpitcairn » Wed Sep 21, 2011 12:13 pm

These commands not working on my standalone, but using the yellow and red buttons in the upper left window do accomplish these things — minimize, close window. Why don't the keyboard commands work?
User avatar
drpitcairn
 
Posts: 1023
Joined: Thu Apr 02, 2009 9:39 am
Location: Sedona, Arizona

Re: Command-M? Command-W?

Postby Dan_Kelleher » Wed Sep 21, 2011 1:53 pm

Hi Richard,
You prob need to include an Idle handler in you project script to watch for depression of those key combinations and then either close the window yourself or minimize the window yourself as well. I'm not sure if there is a SuperTalk command (or XCmd) to accomplish the minimization. I did not try to send a click to the yellow button within the title bar of the window. I think I recall SuperTalk control of the minimize "effect".
Daniel.Kelleher@umassmed.edu
SC4.7.3 OSX 10.7.2 Mac Pro
User avatar
Dan_Kelleher
 
Posts: 438
Joined: Sun Jul 06, 2008 2:45 pm
Location: Worcester (wouster as in would) Massachusetts USA

Re: Command-M? Command-W?

Postby drpitcairn » Wed Sep 21, 2011 2:48 pm

Hmm, I'll research the LG.
Thanks.
User avatar
drpitcairn
 
Posts: 1023
Joined: Thu Apr 02, 2009 9:39 am
Location: Sedona, Arizona

Re: Command-M? Command-W?

Postby Lisa » Wed Sep 21, 2011 3:14 pm

If you include a blank "Window" menu in your project, then SuperCard will build the standard "Window" menu automatically and handle things like minimizing, including triggering it with the Command-M shortcut. If not, you'll have to script it by setting the collapsed property of the window. You could put it in your own "Minimize" menu item and assign it a commandChar of "M"; or if you don't want it as a menu item, then I'd put it in a menuKey handler rather than an idle handler.

"Close Window" does not come for free in standalones, except for the button in the title bar. You have to add it as a menu item and assign it the appropriate commandChar, or handle Command-W somewhere else in your scripts.
iMac 24" 3.06 GHz Intel Core 2 Duo, 4 GB RAM, Mac OS X 10.6.8, SC 4.7.3
User avatar
Lisa
 
Posts: 303
Joined: Sun Jul 06, 2008 12:33 pm
Location: San Diego, CA

Re: Command-M? Command-W?

Postby drpitcairn » Fri Sep 23, 2011 7:39 pm

Lisa,
Trying to understand this. If I make an empty window menu, which might look strange, does it always have to be inserted in the window to work as you suggest? Would it also work to have one submenu item that triggers command-M?

Thanks for your help.

Richard
User avatar
drpitcairn
 
Posts: 1023
Joined: Thu Apr 02, 2009 9:39 am
Location: Sedona, Arizona

Re: Command-M? Command-W?

Postby Lisa » Sat Sep 24, 2011 12:15 am

drpitcairn wrote:Trying to understand this. If I make an empty window menu, which might look strange, does it always have to be inserted in the window to work as you suggest?

The Window menu object within your project has to be inserted into the menu bar at runtime:
Code: Select all
on openProject
   insert menu "Window"
end openProject

When you run the project, you'll see a Window menu with all the standard items:

Minimize ⌘M
Zoom
----------
Bring All to Front
----------
<Name of first open window>
<Name of second open window>
etc.

Appearance and behaviors are all handled automatically, ie. no need to create menu items or script anything, including the list of names of open windows at the bottom; when you choose one, it will be brought to the front. The list will be updated automatically as you open/close/minimize windows, with a checkmark symbol by the frontmost window and diamond symbols by any minimized windows.

Two additional points: 1. If your project has any windows that for whatever reason you do not want to appear in the Window menu's list, you can set their inWindowMenu property to false. 2. As far as I've been able to figure out, there's no way to add your own items to this automatic Window menu, or customize it in any way. Even if you create items within your Window menu object, they'll be ignored.

drpitcairn wrote:Would it also work to have one submenu item that triggers command-M?

If you don't want this automatic Window menu (while it's fabulous for multi-window projects, sometimes it's overkill for one-window projects), then you can create your own "Minimize" menu item, assigning it the Command-M shortcut, in any menu or submenu you'd like, but you'll have to provide the appropriate script for it, setting the "collapsed" property of the frontmost window to true.

If you don't want either the automatic Window menu or a self-scripted "Minimize" menu item, then you can still trigger window minimization with Command-M by scripting it in a menuKey handler.
Code: Select all
on menuKey tKey
   if tKey = "M" then set the collapsed of this wd to true
end menuKey

HTH :-)
iMac 24" 3.06 GHz Intel Core 2 Duo, 4 GB RAM, Mac OS X 10.6.8, SC 4.7.3
User avatar
Lisa
 
Posts: 303
Joined: Sun Jul 06, 2008 12:33 pm
Location: San Diego, CA

Re: Command-M? Command-W?

Postby drpitcairn » Sat Sep 24, 2011 6:18 am

Thank you Lisa. I understand.
User avatar
drpitcairn
 
Posts: 1023
Joined: Thu Apr 02, 2009 9:39 am
Location: Sedona, Arizona


Return to Building Standalones

Who is online

Users browsing this forum: No registered users and 1 guest

cron