How to select menuitem by script ?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 9647
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: How to select menuitem by script ?
Here is a stack that has been rolled. Jean-Marc, is it what you intended?
Craig
Craig
-
- VIP Livecode Opensource Backer
- Posts: 2718
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
Re: How to select menuitem by script ?
Craig,
No, user must see menuitems list
No need answer dialog, just the same as my stack but simpler with a menu btn.
It is for help users to use tools of one app.
Jean-Marc
No, user must see menuitems list
No need answer dialog, just the same as my stack but simpler with a menu btn.
It is for help users to use tools of one app.
Jean-Marc
https://alternatic.ch
-
- VIP Livecode Opensource Backer
- Posts: 3581
- Joined: Mon Jan 22, 2007 7:36 am
- Location: Berkeley, CA, US
- Contact:
Re: How to select menuitem by script ?
Here's my attempt at dealing with pulldown, option, and combobox menu buttons.
The main code is in the stack script, and the mouseUp handlers in the buttons at the bottom are pretty minimal.
The main code is in the stack script, and the mouseUp handlers in the buttons at the bottom are pretty minimal.
- Attachments
-
- buttonPusher.livecode.zip
- (1.31 KiB) Downloaded 167 times
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
-
- VIP Livecode Opensource Backer
- Posts: 9647
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: How to select menuitem by script ?
I guess I am just not understanding. All these examples indeed display the dropDown list. None of them, including mine, under script control hilite one of those visible items.
I do not believe it is possible, due to the "blocking" nature of an open menuItem list. One needs a kludge.
Richard had insight into the reasons we see it this way.
Craig
I do not believe it is possible, due to the "blocking" nature of an open menuItem list. One needs a kludge.
Richard had insight into the reasons we see it this way.
Craig
-
- VIP Livecode Opensource Backer
- Posts: 3581
- Joined: Mon Jan 22, 2007 7:36 am
- Location: Berkeley, CA, US
- Contact:
Re: How to select menuitem by script ?
Maybe it's an OS thing then because I'm seeing the option and combo boxes highlight the selection before closing.
[Update] Yep - just tried this on OSX and it's completely different. So much for cross-platform controls.
[Update] Yep - just tried this on OSX and it's completely different. So much for cross-platform controls.
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
-
- VIP Livecode Opensource Backer
- Posts: 9823
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: How to select menuitem by script ?
When should a tools provider like LC embrace OS-native implementations, and when should they invest in reinventing OS-supplied routines in non-standard ways for conformity with other OSes?
I don't have a clear universal rubric to answer that question. But that's the question.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- VIP Livecode Opensource Backer
- Posts: 3581
- Joined: Mon Jan 22, 2007 7:36 am
- Location: Berkeley, CA, US
- Contact:
Re: How to select menuitem by script ?
I don't have a generic answer either, but that's not critical to this problem...
OSX option menus show up centered vertically on the current selection (menuHistory).
On linux the options show up as a list below the button.
Windows: dunno.
On linux the controls are not blocked and can still be manipulated.
On OSX clicking on a control blocks anything else from happening until it's clicked to close.
It's not specific to LiveCode, but the way the different operating systems treat the controls.
So I think LiveCode is actually doing the right thing here by not trying to override the OS, even though it makes life harder for us as aspiring cross-platform developers.
OSX option menus show up centered vertically on the current selection (menuHistory).
On linux the options show up as a list below the button.
Windows: dunno.
On linux the controls are not blocked and can still be manipulated.
On OSX clicking on a control blocks anything else from happening until it's clicked to close.
It's not specific to LiveCode, but the way the different operating systems treat the controls.
So I think LiveCode is actually doing the right thing here by not trying to override the OS, even though it makes life harder for us as aspiring cross-platform developers.
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
-
- VIP Livecode Opensource Backer
- Posts: 9647
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: How to select menuitem by script ?
I learned something, which is always nice.
If I needed to make a pulldown act that way I would simply kludge one together. There is no reason to fret over different OS's if a 15 minute gadget does all that is required, and likely more. LC trumps such limitations.
But it is very useful to know that different OS's act differently. In that sense, it is critical, when considering the "Develop here, publish everywhere" paradigm that one also "test everywhere".
Craig
If I needed to make a pulldown act that way I would simply kludge one together. There is no reason to fret over different OS's if a 15 minute gadget does all that is required, and likely more. LC trumps such limitations.
But it is very useful to know that different OS's act differently. In that sense, it is critical, when considering the "Develop here, publish everywhere" paradigm that one also "test everywhere".
Craig
-
- VIP Livecode Opensource Backer
- Posts: 9823
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: How to select menuitem by script ?
Definitely test everywhere. Always. With anything running cross platform, even web pages.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn