Tab Menus
Ken Ray
kray at sonsothunder.com
Wed Oct 9 09:27:01 EDT 2002
> Just thought I'd add a little thing to the answers by
> Ken and Jeanne.
> If you want to make your stack multi-lingual at some
> point in the future, it might be more interesting to
> find out which button is pressed: the first, second,
> third,...
Excellent suggestion, Jan. Always good to think about this when developing.
> In such cases, the following piece of code comes in
> handy:
> on menuPick pNewItem
> put return & (the text of me) & return into \
> tText
> put return & pNewItem & return into tNewItem
> go card lineOffset(tNewItem, tText)
> end menuPick
> The whole trick with prepending and appending returns
> is to ensure that if you have two items "History B"
> and "History" it still picks the correct line.
You can do this a bit easier by setting the "wholematches" property:
on menuPick pNewItem
set the wholeMatches to true
go card lineOffset(tNewItem,the text of me)
end menuPick
Ken Ray
Sons of Thunder Software
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/
More information about the use-livecode
mailing list