OSX Status Menu
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Livecode Opensource Backer
- Posts: 120
- Joined: Tue May 22, 2012 1:57 pm
- Location: Vicenza (Italy)
- Contact:
OSX Status Menu
Hi,
How to possible create an app which run in OSX Status Menu?
Thanks,
Paolo
How to possible create an app which run in OSX Status Menu?
Thanks,
Paolo
Paolo Borzini | paolo@borzini.it
The WhiteFly Software | www.thewhitefly.it
Service on line for printers | www.4pellicole.it
The WhiteFly Software | www.thewhitefly.it
Service on line for printers | www.4pellicole.it
-
- Posts: 634
- Joined: Wed Apr 24, 2013 4:53 pm
- Contact:
-
- Livecode Opensource Backer
- Posts: 120
- Joined: Tue May 22, 2012 1:57 pm
- Location: Vicenza (Italy)
- Contact:
Re: OSX Status Menu
Hi Paul,
thank you for the reply but the link is for Xcode
I've found an experimental command in LiveCode 4.5 Release Notes – Revision 13:
But don't work in OS X nor Windows7
Paolo
thank you for the reply but the link is for Xcode
I've found an experimental command in LiveCode 4.5 Release Notes – Revision 13:
Code: Select all
Status icon support (experimental)
Windows, Linux and Mac OS X all have an area where so-called 'status icons' can be displayed. On Windows this is the system tray on the bottom right of the start bar, on Linux this is typically the right of the panel at the top of the screen, and on Mac OS X this is on the menubar.
The engine has support for adding a single status icon, and it can be configured using the statusIcon, the statusIconTooltip and the statusIconMenu:
set the statusIcon to imageId
set the statusIconMenu to iconMenuSpec set the statusIconToolTip to toolTip
Here imageId is the id of the image you wish to use as the icon. It will be scaled down automatically to the appropriate size for the platform and then set. The toolTip specifies what message appears when the user hovers over the status icon.
The iconMenuSpec allows you to configure a menu that will appear when the user does a 'menu' click on the icon. This string uses a subset of the standard engine menu specification:
[ <tab> * ] [ '(' ] <label> [ '|' <tag> ]
Here the number of tabs determines the depth of the menu (i.e. use this to create sub-menus). The
optional tag is used when calling the statusIconMenuPick message.
Before the engine displays the status icon menu, it will send a statusIconMenuOpening menu to the current card of the defaultStack. You can use this opportunity to change the icon menu before it is displayed, this is an analog to handling mouseDown in a menu button.
When the user selects an item from the dock menu, the engine will send an statusIconMenuPick message to the current card of the default stack:
iconMenuPick which
Here which will be a list of labels or tags (if specified) separated by '|' which determines which item
was selected.
In addition, the engine will send the following message in response to clicks on the icon:
statusIconMenuClick button
statusIconMenuDoubleClick button
You can use these to perform an appropriate action.
Note: If you wish to display a menu from the status icon you must use the statusIconMenu property, attempting to open a normal popup menu in response to one of the click messages is not guaranteed to work.
Note: This syntax is only implemented on Windows at the moment and replaces the previously unsupported use of the icon and the iconMenu for this purpose. The properties specified above will have no effect on Mac OS X and Linux at this time.
Important: This feature is currently experimental. This means that it may not be complete, or may fail in some circumstances that you would expect it to work. Please do not be afraid to try it out as we need feedback to develop it further.
Paolo
Paolo Borzini | paolo@borzini.it
The WhiteFly Software | www.thewhitefly.it
Service on line for printers | www.4pellicole.it
The WhiteFly Software | www.thewhitefly.it
Service on line for printers | www.4pellicole.it
Re: OSX Status Menu
Buongiorno Paolo,
I'm afraid this has never been implemented correctly (or at all, can't remember this one and I have an elephants memory!),
so this does of course not work in any version of Livecode on any platform, sorry!
Best
Klaus
I'm afraid this has never been implemented correctly (or at all, can't remember this one and I have an elephants memory!),
so this does of course not work in any version of Livecode on any platform, sorry!
Best
Klaus
Re: OSX Status Menu
It works on Windows. At least it did last time I used it. Not that that helps you.
-
- Livecode Opensource Backer
- Posts: 120
- Joined: Tue May 22, 2012 1:57 pm
- Location: Vicenza (Italy)
- Contact:
Re: OSX Status Menu
Hi SparkOut,
Because my attempts with Windows 7 are unsuccessful.
Paolo
What version of Windows?SparkOut wrote:It works on Windows.
Because my attempts with Windows 7 are unsuccessful.
Paolo
Paolo Borzini | paolo@borzini.it
The WhiteFly Software | www.thewhitefly.it
Service on line for printers | www.4pellicole.it
The WhiteFly Software | www.thewhitefly.it
Service on line for printers | www.4pellicole.it
-
- Livecode Opensource Backer
- Posts: 120
- Joined: Tue May 22, 2012 1:57 pm
- Location: Vicenza (Italy)
- Contact:
Re: OSX Status Menu
Guten morgen Klaus,
"This feature is currently experimental"
After it was written ...
"Please do not be afraid to try it out as we need feedback to develop it further"
...but from 4.5 to 7.6 it seems to have not done anything yet,
perhaps they did not have enough feedback
Paolo
In fact, from what is written in the 4.5 release notes:Klaus wrote: I'm afraid this has never been implemented correctly (or at all, can't remember this one and I have an elephants memory!),
so this does of course not work in any version of Livecode on any platform, sorry!
"This feature is currently experimental"
After it was written ...
"Please do not be afraid to try it out as we need feedback to develop it further"
...but from 4.5 to 7.6 it seems to have not done anything yet,
perhaps they did not have enough feedback
Paolo
Paolo Borzini | paolo@borzini.it
The WhiteFly Software | www.thewhitefly.it
Service on line for printers | www.4pellicole.it
The WhiteFly Software | www.thewhitefly.it
Service on line for printers | www.4pellicole.it
Re: OSX Status Menu
This stack still works on Windows 7 in LC 7.0.5, tested just now in the IDE.
On uniconifying you will probably have to mess around with the stack shape and size.
Edit: Although any mention of the status icon in the Dictionary seems to have vanished. (Maybe because it was only on Windows and Windows 8 doesn't seem to have a status icon area that works like that?)
On uniconifying you will probably have to mess around with the stack shape and size.
Edit: Although any mention of the status icon in the Dictionary seems to have vanished. (Maybe because it was only on Windows and Windows 8 doesn't seem to have a status icon area that works like that?)
- Attachments
-
- statusIconMenuTest.zip
- (3.68 KiB) Downloaded 285 times
-
- Livecode Opensource Backer
- Posts: 120
- Joined: Tue May 22, 2012 1:57 pm
- Location: Vicenza (Italy)
- Contact:
Re: OSX Status Menu
Hi SparkOut,
thanks for the sample.
But on my Windows 7 64bit in .exe format not work
Paolo
thanks for the sample.
But on my Windows 7 64bit in .exe format not work
Paolo
Paolo Borzini | paolo@borzini.it
The WhiteFly Software | www.thewhitefly.it
Service on line for printers | www.4pellicole.it
The WhiteFly Software | www.thewhitefly.it
Service on line for printers | www.4pellicole.it
-
- Posts: 722
- Joined: Thu Sep 11, 2014 1:49 pm
- Location: The Netherlands
Re: OSX Status Menu
I have got it working in Windows 10 64 bits (LiveCode Indy 7.1 (rc 1)).
I did the following :
Step one:
Make a new stack with the name: TestWinTray
add a hidden icon (jpg) with 32x32 pixels (set isonsize to 32 x 32) and give the icon the id number 21006 (otherwise this example will not work)
then copy the following in the main stack
Step two:
Put a button on that stack named : test iconify . This button must be there because without it it does not work (not clear why). Just hide it if you do not use it.
put the following script in the button:
And last step three:
Place the following code in the main card
When stack is hidden click on the icon with right mouse button to see your choices.
Hope this works for you as well.
I also uploaded the stack as it works for me however after initial startup of the stack the first time I minimize the stack the pickmenu on the icon does not work, maximize again *by selecting it from livecode and after this it magically keeps working ???? Maybe someone has a suggestion ?
Kind regards,
MrCoolLion (Paul)
I did the following :
Step one:
Make a new stack with the name: TestWinTray
add a hidden icon (jpg) with 32x32 pixels (set isonsize to 32 x 32) and give the icon the id number 21006 (otherwise this example will not work)
then copy the following in the main stack
Code: Select all
on preOpenStack
set the statusIcon to 0 // Just to make sure there is no icon of this stack showing. Should not be necessary
end preOpenStack
on unIconifyStack
show this stack
set the statusIcon to 0 // does work
pass unIconifyStack
end unIconifyStack
on iconifyStack
send "hideme" to me in 50 millisecs -- bug 7531
set the statusIcon to 21006
set the statusIconMenu to "Show" & cr & "Other"
pass iconifyStack
end iconifyStack
Put a button on that stack named : test iconify . This button must be there because without it it does not work (not clear why). Just hide it if you do not use it.
put the following script in the button:
Code: Select all
on mouseUp
set the iconic of this stack to true
set the statusIcon to 21006
end mouseUp
Place the following code in the main card
Code: Select all
on statusIconMenuPick pPick
if pPick is "Show" then
answer "Going to show"
set the statusIcon to 0
set the iconic of stack "TestWinTray" to false
end if
if pPick is "Other" then
answer "Doing other"
end if
if pPick is not "Show" and pPick is not "Other" then
answer "not Show, not Other"
end if
end statusIconMenuPick
Hope this works for you as well.
I also uploaded the stack as it works for me however after initial startup of the stack the first time I minimize the stack the pickmenu on the icon does not work, maximize again *by selecting it from livecode and after this it magically keeps working ???? Maybe someone has a suggestion ?
Kind regards,
MrCoolLion (Paul)
- Attachments
-
- WinSysTrayExample1.zip
- (1.49 KiB) Downloaded 289 times
-
- Posts: 634
- Joined: Wed Apr 24, 2013 4:53 pm
- Contact:
Re: OSX Status Menu
Not specifically for LiveCode but this tool could probably be used to achieve custom made Mac StatusBar with LC interaction via shell scripting with out ever using X-Code:
http://web.mit.edu/cron/system/macathen ... ation.html
There was another creating tool called Tapir but it's old/outdated (though source-code is available).
http://web.mit.edu/cron/system/macathen ... ation.html
There was another creating tool called Tapir but it's old/outdated (though source-code is available).