Page 1 of 1

send menupick

Posted: Sun Sep 21, 2008 11:42 pm
by Glenn Boyce
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

Posted: Mon Sep 22, 2008 6:16 am
by Janschenkel
The easiest way is to set the 'menuHistory' property of the tabbed button. It expects a number.

Code: Select all

set the menuHistory of button "Tabbed button" to 1 -- selects the first tab
If you're not sure about the position, you can use the 'lineOffset' function to find out where it is.

Code: Select all

put lineOffset("General", the text of button "Tabbed button") into tLineNumber
set the menuHistory of button "Tabbed button" to tLineNumber
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.

Code: Select all

lock messages -- prevent 'menuPick' message
set the menuHistory of button "Tabbed button" to 1 -- selects the first tab
unlock messages
Hope this helped,

Jan Schenkel.

menu tab

Posted: Mon Sep 22, 2008 6:18 am
by Glenn Boyce
Great thanks very much