button "Tab Menu"

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
MaxV
Posts: 1580
Joined: Tue May 28, 2013 2:20 pm
Contact:

button "Tab Menu"

Post by MaxV » Mon Jan 20, 2014 6:08 pm

Hello,
I love "Tab Menu" buttons, but how to switch between tab buttons without clicking on them?
For example I have a stack with 3 card, my "Tab Menu" 3 buttons permit to go to the respective card clicking on them;
but on the contrary, when I need to go to a card without clicking on my tab menu, how can I switch the "tab menu" to the correct tab?
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4174
Joined: Sun Jan 07, 2007 9:12 pm

Re: button "Tab Menu"

Post by bn » Mon Jan 20, 2014 7:51 pm

Hi Max,

look at "menuHistory" in the dictionary

Code: Select all

on mouseUp
   lock messages
   set the menuhistory of button 1 of card 1 to 1
   unlock messages
end mouseUp
use lock messages to not trigger tab 1 when setting it.

Kind regards
Bernd

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10333
Joined: Wed May 06, 2009 2:28 pm

Re: button "Tab Menu"

Post by dunbarx » Mon Jan 20, 2014 11:56 pm

Hi.

What Bernd said.

But if you are navigating via other methods than clicking on the tab menu button, you may be better served using his idea in an openCard handler, where the tab is set based on some card property, like name or number. Still have to lock messages, of course.

Craig Newman

MaxV
Posts: 1580
Joined: Tue May 28, 2013 2:20 pm
Contact:

Re: button "Tab Menu"

Post by MaxV » Tue Jan 21, 2014 11:27 am

Great! It works!
Thank you!!! :D
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

Post Reply