[squeak-dev] What can be an actionSelector

Gary Dunn osp at aloha.com
Sat Jun 20 08:49:14 UTC 2009


On Fri, 2009-06-19 at 20:06 +0530, K. K. Subramaniam wrote:
> On Friday 19 June 2009 05:06:25 pm Gary Dunn wrote:
> > Having created a minimal stack, I set out to learn how to provide
> > navigation controls. I placed a buttom morph on the background used
> > later in the stack with a target of the name of the StackMorph and an
> > actionSelector of goToFirstCardOfStack. This works. But when I put a
> > button on the first page, which has a different background, and make its
> > actionSelector goToNextCardInStack, nothing happens. If I make it flash,
> > the default, the book flashes,
> How many pages do you have in your Stack? Inspect it. While inspecting, you 
> can also debug sends like 'self goToNextCardInStack'. Trace through and check. 
> This may appear tedious but it is a good way to pick up Squeak internals.
> 
> Subbu
> 

First an update. Two changes. First, the difference I saw between the
two computers is not there. They behave the same. Second, I got the
button working but I don't know why. I just deleted the one and created
a new one. This one works with nextPage and goToNextCardOfStack, but
they do not do the same thing. I am using a ScriptableButton, taken from
the Objects menu.

My stack has three pages, which seem to act like backgrounds. I have one
instance of the first page, four of the second, and two of the third.
When I navigate with the StackMorph menu, < and >, the cards display in
sequence, as expected. The > menu item sends goToNextCardInStack. My
Start button is on the title page. I have another button attached to the
background of the second page which goes to the first page (a "Home"
button). Because it is attached to the background it appears on every
card of that background. If I am on the third card (second card of
second page) and click the home button I go to the first card, which is
correct. But if I then click the Start button when set to nextPage I go
to where I was on the second page, card #3. So I set it send
goToNextCardInStack and that does what I want.

The problem I still have is that unless the button is attached to the
background it disappears when I yellow-click anything. I found the
button while inspecting the page. It is listed under submorphs, along
with the two text morphs also on the page:

an Array(a ScriptableButton<StartButton>(886) a
TextMorph<PublishInfo>(2522) a TextMorph<Title>(2417))

If I have that inspector open and yellow-click anything, the part about
the button disappears, along with the button. Setting "resist being
deleted" does not help.

If I blue-click the button and click the red menu button, stacks and
cards, and select "put into background," it no longer disappears. 

I have cards with sketch morphs on them that do not behave this way. Are
there morphs that must be attached to the background and others that can
float on top of a background?

-- 
Gary Dunn, Honolulu
osp at aloha.com
http://openslate.net/
http://e9erust.blogspot.com/
Sent from Slate001




More information about the Squeak-dev mailing list