Protocol viewer ?

Gary McGovern garywork at lineone.net
Tue Sep 25 19:44:56 UTC 2001


Hello Ned,
I'm really sorry to keep this thread going and I appreciate all the effort
put into your replies, but I feel I have to clear something up here (with my
exam only 3 weeks away).

Protocol is defined in my course as:
A set of messages that an object understands
now when I evaluate
bill size
I get an error and so obviously bill doesn't understand the message size.
And therefore size isn't part of the protocol of bill. But it is listed in
the entire protocol of  AdvancedB3DSceneMorph.
So I'm trying to find if size listed as part of the protocol of
AdvancedB3DSceneMorph.
is a flaw in the protocol browser or a flaw in the writing of the Class
AdvancedB3DSceneMorph. This will answer to me all I need to know.
Regards,
Gary




----- Original Message -----
From: "Ned Konz" <ned at bike-nomad.com>
To: <squeak-dev at lists.squeakfoundation.org>
Sent: Tuesday, September 25, 2001 6:18 AM
Subject: Re: Protocol viewer ?


> On Monday 24 September 2001 08:43 pm, Gary McGovern wrote:
> > Hello Ned,
> > Sorry! my mistake. I should have wrote:
> > bill useGradientFill
> > but when looking into it I see that the method is coded to use a solid
> > fill. Nevertheless:
> > bill size
> > brings up an error dialogue.
> > The protocol is so large that I only tried a number of random messages.
> > I'm curious to know the reason why 'bill size' brought up the error. Is
it
> > because 'size' isn't part of the protocol or some other reason?
>
> size is defined in Object; it's not part of the Morph protocol. When you
send
> size to bill, you get a walkback that should explain what happened:
>
> Receiver: an AdvancedB3DSceneMorph(3014)
>
> Instance variables:
> bounds: 171 at 34 corner: 271 at 132
> owner: a SystemWindow(1289)
> submorphs: #()
> fullBounds: 171 at 34 corner: 271 at 132
> color: Color transparent
> extension: a MorphExtension (368) [locked]  [other:  (layoutFrame -> a
> LayoutFrame) (layoutProperties -> a LayoutProperties)]
> scene: a B3DScene
> myRenderer: nil
> rotationAngle: 1
> stepTime: 0
> isRotating: true
> oldPoint: nil
> headLightStatus: #on
> savedHeadLight: nil
>
> Method (temp) variables:
> aString: 'AdvancedB3DSceneMorphs are not indexable'
>
> Stack:
> AdvancedB3DSceneMorph(Object)>>error:
> AdvancedB3DSceneMorph(Object)>>errorNotIndexable
> AdvancedB3DSceneMorph(Object)>>size
> UndefinedObject>>DoIt
>
> Note the "(Object)" in the call stack; this shows you that the size method
> that is being called is defined in Object. This can't be the right one,
since
> Objects don't know about physical size in pixels (it would have to be in
> Morph or a subclass).
>
> > I've been bringing up the protocol browser through the menu icon and it
is
> > certainly for the correct class.
>
> Well, then, what you probably want to do is to restrict the extent of the
> protocol. By using the second button from the left, and selecting Morph,
you
> won't see the methods from Object, most of which aren't particularly
> interesting if you're trying to do 3D or Morphic things. Or choose just
the
> class in question, or whatever other view you want to see.
>
> If you're trying to examine the size in pixels of the Morph, you should
look
> at an Inspector (choose "inspect morph"), and note that there is an
instance
> variable called bounds that is a Rectangle. Now you can look for a method
> that will return the extent of that rectangle. Either choose the instance
> variable bounds in the Inspector and select "method refs to this inst
var",
> or in the Protocol Browser, hit the menu button (the left-most one) and
> choose "inst var refs". You'll get a list of methods in either case that
look
> at the bounds variable.
>
> Look through this list until you find "extent", which will return the
extent
> of the bounds rectangle. Or "width", or "height".
>
> --
> Ned Konz
> currently: Stanwood, WA
> email:     ned at bike-nomad.com
> homepage:  http://bike-nomad.com
>
>
>





More information about the Squeak-dev mailing list