[squeak-dev] A question on non-openInWorld-able morphs

karl ramberg karlramberg at gmail.com
Sat Feb 25 09:30:11 UTC 2023


Hi,
What you are trying to do is better accomplished in a browser.
There you can more easily subclass a morph and put in break points to see
what is happening etc.

While you can do much of this from a Workspace it's reccommended to learn
to use a browser.
There is better tool support for maintaining code etc.

See example in attachment.

TestMorph new openInWorld

This morph will halt and open a debugger once you either click on it or use
the keyboard once it has keyboard focus.
In the debugger you can see what messages and values are sent to the morph
etc.

Use this to browse the code:
TestMorph browse

[image: image.png]

Best,
Karl


On Sat, Feb 25, 2023 at 8:21 AM Eduardo Ochs <eduardoochs at gmail.com> wrote:

> Hi list,
>
> I need to ask for more pointers... =(
>
> Now I know how to debug what happens when I send certain keys to
> certains morphs. My code is here - not on the wiki yet, sorry -
>
>   http://anggtwu.net/eev-squeak.html#key-events
>
> and I am using that to learn how lots of things work. But the morphs
> seem to fall in several different families, each one with a different
> way of initializing... for morphs like these ones I can just use
> openInWorld,
>
>   sm := SimpleSwitchMorph new.
>   sm openInWorld.
>   bm := SimpleButtonMorph new.
>   bm openInWorld.
>   bm position: bm position + (0 at 32).
>   rm := RectangleMorph new.
>   rm openInWorld.
>   rm position: rm position + (0 at 64).
>
> but for SelectorBrowser I need to use "prototypicalToolWindow" instead
> of new, and there are other ones, like SearchBar, that I don't know
> how to create a new morph of that kind...
>
> Where can I learn more about that? And where do people usually learn
> how to create interfaces in which a single window displays several
> subwindows and subwidgets? In Tcl/Tk this is considered basic... here
> is an example of this "this": the code below
>
>   frame   .top
>   frame   .bottom
>   text    .textbox -width 10 -height 5
>   listbox .listbox -width 10 -height 5
>   button  .button1 -text B1
>   button  .button2 -text B2
>   button  .button3 -text B3
>   .textbox insert end "Foo\nBar"
>   .listbox insert end "Item 1"
>   .listbox insert end "Item 2"
>   .listbox insert end "Item 3"
>   pack .top     -side top
>   pack .bottom  -side bottom            -fill x -expand 1
>   pack .listbox -side left  -in .top
>   pack .textbox -side right -in .top
>   pack .button1 -side left  -in .bottom -fill x -expand 1
>   pack .button2 -side left  -in .bottom -fill x -expand 1
>   pack .button3 -side left  -in .bottom -fill x -expand 1
>
> creates the window in this screenshot:
>
>   https://i.ibb.co/ZcZGRjW/sshot.png
>
> Thanks in advance! =)
>   Eduardo Ochs
>   http://anggtwu.net/eev-squeak.html
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20230225/cd45b61e/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 69291 bytes
Desc: not available
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20230225/cd45b61e/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TestMorph example.st
Type: application/octet-stream
Size: 950 bytes
Desc: not available
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20230225/cd45b61e/attachment-0001.obj>


More information about the Squeak-dev mailing list