Re: [beginner] assign widget to variable?

morphic morphic at ziplip.com
Wed Dec 5 05:53:36 UTC 2001


ok, got it. thanks for the many ways. grabbing the widget and dropping it on the rhs of an assignment seems most direct. my problem was that (apparently) inspecting a widget doesn't yield a straightforward specification of how to refer to it. For example, the inspector opens with the title "a BookMorph(1559)" but the book's reference after drag-and-drop is "book1559".

e

> -----Original Message-----
> From: Ned Konz [mailto:ned at bike-nomad.com]
> Sent: Tuesday, December 04, 2001, 8:16 PM
> To: squeak-dev at lists.squeakfoundation.org
> Subject: Re: [beginner] assign widget to variable?
> 
> On Tuesday 04 December 2001 07:19 pm, morphic wrote:
> > once you drag a widget out and place it somewhere, is there a way to assign
> > it to a variable so that you can then send it messages? I realize you can
> > create things with openInWorld, and that you can do a lot of things via
> > halos and menus, but I also want to be able to send messages via a line of
> > code to things already dragged out. e
> 
> You can do this easily in a workspace.
> 
> From its menu, check "create textual references for dropped morphs". Then 
> drop a Morph on the workspace. It will slide back to where it was, leaving 
> its name (bound to the Morph in the Workspace's private dictionary).
> 
> From there you can write code in the Workspace to use it.
> 
> There is also the clipboard; you can copy a Morph to the clipboard and refer 
> to it as
>        ActiveHand pasteBuffer
> 
> Or you can do something like (if you know there's only one of your kind of 
> Morph about):
> 
>     MyMorphClass allInstances first
> 
> or
>      MyMorphClass someInstance
> 
> -- 
> Ned Konz
> currently: Stanwood, WA
> email:     ned at bike-nomad.com
> homepage:  http://bike-nomad.com
> 
> 




More information about the Squeak-dev mailing list