problem with tab panel
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
problem with tab panel
Hi everybody. I can't seems to switch tab panel when i used words like 'Name', 'Family' and numeric numbers. If I name my tab name 'Tab 1', 'Tab 2', the script shows an error. Why?
Re: problem with tab panel
Hi pmc
Various cases are possible
Post your script and we can help you
Best
Jean-àMarc
Various cases are possible
Post your script and we can help you
Best
Jean-àMarc
https://alternatic.ch
Re: problem with tab panel
Hi thanks. Image 'capture4' is the script. 'Capture5' is the card's name. 'Capture6' is Tab. Why is the 'Family' color in the script different and why can't I use the word 'Family'?
BTW I have solve the Tab1,2 and 3 problem. I have type a space between the 'Tab1' in the script. Instead of 'Tab1', i put in 'Tab 1'. I didn't know that spaces are not allow in the script.
Thanks in advance.
BTW I have solve the Tab1,2 and 3 problem. I have type a space between the 'Tab1' in the script. Instead of 'Tab1', i put in 'Tab 1'. I didn't know that spaces are not allow in the script.
Thanks in advance.
- Attachments
-
- Capture6.GIF (2.94 KiB) Viewed 8350 times
-
- Capture5.GIF (6.6 KiB) Viewed 8350 times
-
- Capture4.GIF (3.6 KiB) Viewed 8350 times
Re: problem with tab panel
Hi pmc,
family is a reserved word. It is used by Livecode, you can not use it to name an object. Look it up in the dictionary. The coloring indicates that it is a reserved name.
Just give your card an other name.
Edit: I forgot to tell you that it is probably a good idea to put quotes around names. If you dont then Livecode will first think it is a varible and only if that variable is not filled will it use it literally.
You might get away with not quoting but it will make mistakes hard to handle, for example if you use the name also as a variable name then you get into trouble.
So: dont use reserved words (even quoted) and quote your literals.
regards
Bernd
family is a reserved word. It is used by Livecode, you can not use it to name an object. Look it up in the dictionary. The coloring indicates that it is a reserved name.
Just give your card an other name.
Edit: I forgot to tell you that it is probably a good idea to put quotes around names. If you dont then Livecode will first think it is a varible and only if that variable is not filled will it use it literally.
You might get away with not quoting but it will make mistakes hard to handle, for example if you use the name also as a variable name then you get into trouble.
So: dont use reserved words (even quoted) and quote your literals.
regards
Bernd
Re: problem with tab panel
Thanks, Bernd. Help appreciated. I think I'll put in the 'quote'. It is just for a few naming. Thanks.
Re: problem with tab panel
Hi pmc,
please check the docs (Rev Dictionary), which aren't that bad actually!, for "menupick"!
There is a special syntax for TABBED buttons, sou you just need ONE handler for your navigation:
Best
Klaus
please check the docs (Rev Dictionary), which aren't that bad actually!, for "menupick"!
There is a special syntax for TABBED buttons, sou you just need ONE handler for your navigation:
Code: Select all
on menupick NewTab, OldTab
## In your case do this:
go cd NewTab
end menupick
Klaus
Re: problem with tab panel
Hi Klaus
You are a genius. Thanks. Your script is short and to the point. Now I want need to have a particular tab open whenever I go to that stack. For instance, when I open stack A, I need the tab to be on the 1st tab all the time. I tried this :
on stack open
go to tab 1st
end
It doesn't work.
The learning curve is very steep for livecode.
You are a genius. Thanks. Your script is short and to the point. Now I want need to have a particular tab open whenever I go to that stack. For instance, when I open stack A, I need the tab to be on the 1st tab all the time. I tried this :
on stack open
go to tab 1st
end
It doesn't work.
The learning curve is very steep for livecode.
Re: problem with tab panel
Hi pmc,
you need to set the "menuhistory" of your tabbed button to the NUMBER of the line containing the desired "Tab":
To ease the learning curve I advice you to work through some or all stack here:
http://www.runrev.com/developers/lesson ... onferences
Best
Klaus
you need to set the "menuhistory" of your tabbed button to the NUMBER of the line containing the desired "Tab":
Code: Select all
on openstack
...
set the menuhistory of btn "your tab btn here" of cd X to 1
...
end openstack
http://www.runrev.com/developers/lesson ... onferences
Best
Klaus
Re: problem with tab panel
Hi Klaus
The script as below:
on menupick NewTab, OldTab
## Changing between Tabs:
go cd NewTab
end menupick
on openstack
set the menuhistory of btn 'Home' of cd X to 1
end openstack
It isn't working. The tab remains at the last when open.
The script as below:
on menupick NewTab, OldTab
## Changing between Tabs:
go cd NewTab
end menupick
on openstack
set the menuhistory of btn 'Home' of cd X to 1
end openstack
It isn't working. The tab remains at the last when open.
Re: problem with tab panel
Hi pmc,
the script is OK, trust me
Remember that "openstack" will only get sent ONCE when the stack opens and appears aon screen
Maybe you mean/should try "opencard" or even "preopencard"?
Best
Klaus
the script is OK, trust me

Remember that "openstack" will only get sent ONCE when the stack opens and appears aon screen
Maybe you mean/should try "opencard" or even "preopencard"?
Best
Klaus
Re: problem with tab panel
I have tried it with
openstack and preopenstack and even opencard
it still goes to the last tab which was open.
This script is supposed to be on the button (which opens the card with the tab panel) or on the tab panel of the card itself?
openstack and preopenstack and even opencard
it still goes to the last tab which was open.
This script is supposed to be on the button (which opens the card with the tab panel) or on the tab panel of the card itself?
Re: problem with tab panel
Hi pmc,
It looks like you should put it into the button that opens the card with the TABBED button.
And of course in the "mouseup" handler!
Best
Klaus
Neither nor! Since these messages are never sent to a button!pmc wrote:I have tried it with
openstack and preopenstack and even opencard
it still goes to the last tab which was open.
This script is supposed to be on the button (which opens the card with the tab panel) or on the tab panel of the card itself?
It looks like you should put it into the button that opens the card with the TABBED button.
And of course in the "mouseup" handler!

Best
Klaus
Re: problem with tab panel
Thanks Klaus.
I got an error message with the script.
I got an error message with the script.
- Attachments
-
- Capture1.GIF (19.59 KiB) Viewed 8288 times
Re: problem with tab panel
Hi pmc,
-> set the menuhistory of btn 'Home' of cd X to 1
OH, COME ON!
My good education prohibits further comments!
-> set the menuhistory of btn 'Home' of cd X to 1
OH, COME ON!

My good education prohibits further comments!

Re: problem with tab panel
Sorry, Klaus. I thought it was some kinda of script or code. I really do not understand the script.
set the menuhistory of btn 'Name' of cd "Name" to 1
when we said :
menuhistory of btn...
which btn are we talking about? Is it the Tab? Is the Tab also consider a btn in this case?
Thanks Klaus. Please do not get agitated by my stupidity.
set the menuhistory of btn 'Name' of cd "Name" to 1
when we said :
menuhistory of btn...
which btn are we talking about? Is it the Tab? Is the Tab also consider a btn in this case?
Thanks Klaus. Please do not get agitated by my stupidity.