send menupick

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Glenn Boyce
Posts: 137
Joined: Thu Jul 24, 2008 11:22 pm

send menupick

Post by Glenn Boyce » Sun Sep 21, 2008 11:42 pm

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

Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Contact:

Post by Janschenkel » Mon Sep 22, 2008 6:16 am

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.
Quartam Reports & PDF Library for LiveCode
www.quartam.com

Glenn Boyce
Posts: 137
Joined: Thu Jul 24, 2008 11:22 pm

menu tab

Post by Glenn Boyce » Mon Sep 22, 2008 6:18 am

Great thanks very much

Post Reply