I want to select a card with a tab menu and set the tab menu to the first item - which happens to be called "General". I've played around and just can't get the syntax. Any assistance welcome
Glenn
send menupick
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 977
- Joined: Sat Apr 08, 2006 7:47 am
- Contact:
The easiest way is to set the 'menuHistory' property of the tabbed button. It expects a number.
If you're not sure about the position, you can use the 'lineOffset' function to find out where it is.
Note that setting the 'menuHistory' will also send the 'menuPick' message to your tabbed button. If you want to cicrumvent this side effect, you'll need to lock the messages before setting it.
Hope this helped,
Jan Schenkel.
Code: Select all
set the menuHistory of button "Tabbed button" to 1 -- selects the first tab
Code: Select all
put lineOffset("General", the text of button "Tabbed button") into tLineNumber
set the menuHistory of button "Tabbed button" to tLineNumber
Code: Select all
lock messages -- prevent 'menuPick' message
set the menuHistory of button "Tabbed button" to 1 -- selects the first tab
unlock messages
Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com
www.quartam.com