Can a livecode app be a menuitem app on Mac?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Can a livecode app be a menuitem app on Mac?
Hi
The topic says it all:
Can a livecode app be a menuitem app on Mac?
Thanks
Mic
The topic says it all:
Can a livecode app be a menuitem app on Mac?
Thanks
Mic
Re: Can a livecode app be a menuitem app on Mac?
Hi Mic,
sorry, I have no idea what that means?
Best
Klaus
sorry, I have no idea what that means?
Best
Klaus
-
- VIP Livecode Opensource Backer
- Posts: 190
- Joined: Sat Apr 08, 2006 7:55 am
- Location: Lübbecke, Germany
- Contact:
Re: Can a livecode app be a menuitem app on Mac?
You mean you want your LC app to stay in the menu bar or better said you want your LC app to display a menu in the status bar on Mac?
If that's the question then yes.
Have a look at 'mac status menu' in the dictionary.
If that's the question then yes.
Have a look at 'mac status menu' in the dictionary.
Re: Can a livecode app be a menuitem app on Mac?
Thank you matthiasr, but the dictionary is not very helpful. Could you point me to a little example stack that goes into the menubar on Mac?
Thanks
Mic
Re: Can a livecode app be a menuitem app on Mac?
Hi again
I possible, could anybody be kind and give me an example of this?
Thanks
Mic
I possible, could anybody be kind and give me an example of this?
Thanks
Mic
Re: Can a livecode app be a menuitem app on Mac?
Hi Mic,
you need to know that the menu in the Mac menubar will only visible as long as LC or your standalone is open, even if in background!
If you quit LC or your runtime, the menu will disappear!
OK, here an example with comments, if in doubt, don't hesitate to ask:
Hope that gets you started!
Best
Klaus
you need to know that the menu in the Mac menubar will only visible as long as LC or your standalone is open, even if in background!
If you quit LC or your runtime, the menu will disappear!
OK, here an example with comments, if in doubt, don't hesitate to ask:
Code: Select all
## These two handlers could/shpuld go into the stack script
## And of course you can name the hanlders as you like!
command create_a_menu
## Create a menu with this command.
## the parameter is a name which will not be shown anywhere
## but you will need it to manage the menu later:
macStatusMenuCreate "el_menu"
## Now set some properties to make the menu usable
## ENABLE the menu
macStatusMenuSet "el_menu", "enabled", TRUE
## Define an icon for the menu
macStatusMenuSet "el_menu", "icon", the long id of image "your image here"
## Create the content of the menu
## Hint: I use silly contents, just for the fun of it! :-D
macStatusMenuSet "el_menu", "items", "Blabla" & return & "-" & return & "YaddaYadda"
## Now the menu is visible and active!
end create_a_menu
## What should happen when the user selects a menuitem:
on macStatusMenuPick "el_menu", tSelectedItem
switch tSelectedItem
case "Blabla"
answer "Even more blablablabla..."
break
case "YaddaYadda"
abswer "YaddaYadda, daddy-o! :-)"
break
end switch
## Of course you can execute anything you need instead of my silly ANSWERs :-)
end macStatusMenuPick
############################################################################
## You can remove the menu anytime you want to with_
### macStatusMenuDelete "el_menu"
############################################################################
## Maybe create the menu on openstack
on openstack
create_a_menu
## More openstack stuff here...
end openstack
Best
Klaus
Re: Can a livecode app be a menuitem app on Mac?
Thank you Klaus
Made your script work!
Made this alteration: macStatusMenuSet "el_menu", "enabled", TRUE —> macStatusMenuSet el_menu, "enabled", TRUE. (no quotes on el_menu)
Could not make the icon work. Tried different versions of Long ID with and without quotes, but just got a black square.
NOW, the menuitem I had in mind is actually menuless, but has just one little window for jotting down a sketch and auto coping to clipboard.
so Im a little back to square one...
Mic
Made your script work!
Made this alteration: macStatusMenuSet "el_menu", "enabled", TRUE —> macStatusMenuSet el_menu, "enabled", TRUE. (no quotes on el_menu)
Could not make the icon work. Tried different versions of Long ID with and without quotes, but just got a black square.
NOW, the menuitem I had in mind is actually menuless, but has just one little window for jotting down a sketch and auto coping to clipboard.
so Im a little back to square one...
Mic
Re: Can a livecode app be a menuitem app on Mac?
Hi Mic,
I think this is 24*24 pixels.
Best
Klaus
Then this is an error in the Dictionary, will report that.
Make sure your image makes sense when displayed in its tinyness!
I think this is 24*24 pixels.
Well, since the name of this is macsatusMENU... it can only display a (pulldown) menu.
Best
Klaus
Re: Can a livecode app be a menuitem app on Mac?
Kaffee und Kuchen für dich, Klaus
Mic
Mic
Re: Can a livecode app be a menuitem app on Mac?
Lecker, vielen Dank!
Re: Can a livecode app be a menuitem app on Mac?
FYI:
I just reported two bugs regarding macStatusMenu:
https://quality.livecode.com/show_bug.cgi?id=24369
https://quality.livecode.com/show_bug.cgi?id=24371
I just reported two bugs regarding macStatusMenu:
https://quality.livecode.com/show_bug.cgi?id=24369
https://quality.livecode.com/show_bug.cgi?id=24371