[noob again]objects and properties and messages

Ken Ray kray at sonsothunder.com
Mon Mar 28 09:05:12 EST 2005


On 3/28/05 7:33 AM, "Mikey" <mikeythek at gmail.com> wrote:

> Completely by accident I discover the tabStop property for fields, and
> shread a bunch of code from the field, cursing the whole time that the
> tabStop property isn't listed on the Properties palette for fields,
> (at least as far as I could see).

Well, it *is*, but it's under the Table section.

> Then I start playing with the Tab Panel for navigating between cards,
> only to discover that there are apparently a bunch of messages that
> tab panels can receive that other types of buttons do not.  OK, what
> are these?  Well, there doesn't appear to be a list anywhere.  More
> frustration.

Tab buttons receive the menuPick message, in addition to the standard button
messages (mouseUp, mouseDown, etc.). The menuPick message is also used by
any other button that lets you make a choice between a set of items (such as
pulldown, popup, and option button styles). I don't think there are any
other messages that a tab button receives.
 
> As long as I'm on the topic of bitching and expelling frustration, is
> there anybody else that finds the way that backgrounds are handled
> awkward and difficult?

If you are coming from HyperCard or SuperCard, I agree, backgrounds can be
frustrating, but only if you think of them as "backgrounds". If you rather
think of them as shared groups (much like sharedText is for fields), then it
is conceptually easier. I understand why in many cases Rev uses "background"
and "group" interchangeably, but it can certainly be confusing for people
used to traditional backgrounds.

As to their handling, I can say that at the beginning of my learning curve,
I certainly found it awkward and difficult. But that was because I really
didn't understand how to use them, and I still had the "background" concept
in my head from HyperCard/SuperCard. Once I shifted conceptual frames and
worked with them a bit, they not only made sense, but I understood the power
and control that they give you that is lightyears ahead of HC/SC.

If you want to use a tab button to navigate between cards, do this:

If you have a stack with one card and
you'll make the other cards later:
------------------------------------------
1) Create a tab button, set its contents to the names of the cards you're
going to create, and set its size to where you want it.
2) Set the script of the button as:
     
on menuPick pNewCard,pOldCard
  go card pNewCard
end menuPick

3) Group the button, and set the group's 'backgroundBehavior' to true
4) Create the other cards you need (each one will inherit the shared group)
5) Name all of the cards to match the list of card names in the button
contents.
6) Test and move on...

If you have a stack with all the cards
already created and named:
------------------------------------------
1) Go to card 1, Create a tab button, set its contents to the names of the
cards you've already created, and set its size to where you want it.
2) Set the script of the button as:
     
on menuPick pNewCard,pOldCard
  go card pNewCard
end menuPick

3) Group the button, and set the group's 'backgroundBehavior' to true
4) Go to each card and choose Object -> Place Group and select the name of
the group you created in step #1. It will appear on that card in the same
location as it is in card 1.
5) Test and move on...

Note that using 'Place Group' causes a specific card to share the group with
card 1. All cards that have had the group placed on it will share the group
amongst themselves.

HTH,

Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: kray at sonsothunder.com





More information about the use-livecode mailing list