[Newbies] how to bring up a modal window?

Marcel Taeumel marcel.taeumel at hpi.de
Mon Apr 6 12:08:30 UTC 2020

Hi Ralph! :-)

You could try to customize DialogWindow. That dialog's center piece can hold any kind of morph composition. Take a look at FileSaveDialog and its #buildWith: methods to learn how it works. (It's ToolBuilder territory. :-)

If you want to go more basic and implement your own "window morph", I suggest using the HandMorph's #mouseFocus via #newMouseFocus:. From there, you can handle all unser interaction within our without that window's bounds. Here are some more code pointers to look at for this:

- Senders of #newMouseFocus:, filtered after "DialogWindow" or "MenuMorph"
- The implementor DialogWindow >> #processFocusEvent:using:.
- The implementor MenuMorph >> #processFocusEvent:using:.

So, in terms of "modality" Squeak's dialog windows and pop-up menus provide that kind of affordance to its users. BUT dialog windows might be what you are looking for because you have more control over the control flow via DialogWindow >> #getUserResponse, which only returns after the user finished that interaction.

Am 05.04.2020 01:11:43 schrieb Ralph Boland <rpboland at gmail.com>:
I need to create a modal window to which I will add a number of
additional morphs.
I did in an old project (Squeak 3.11 I think) that used classes
MorphicDialogModel and MorphicMessageBox among others and so tried to
port them to my Squeak 5.3 image.
But these didn't seem to work.

Perhaps I can track down the difficulties in getting these classes to work
but perhaps the best thing for me to do is to not use them and create
my modal morphs in the appropriate way for Squeak 5.3.

But I don't know the right way to create a modal window using Squeak 5.3.

Can someone inform me?

Hopefully this is an easy question.

Pointing me in the direction as to what/where I should read the right
would also be very helpful.

Any help much appreciated.

Ralph Boland
Beginners mailing list
Beginners at lists.squeakfoundation.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/beginners/attachments/20200406/15d1819d/attachment.html>

More information about the Beginners mailing list