[Q] How to suppress modal dialogs while loading code updates?

John W. Sarkela sarkela at sbcglobal.net
Tue Jun 10 18:56:37 UTC 2003


Well, I would propose one of two strategies, both of which require 
reimplementing these modal UI requests.

1. Raise a UserInterfaceNotification exception in the implementation of 
#inform: and friends and make the default handler action to be the 
current implementation.

2. Use the Squeak World Tour strategy of having a current UI handler 
object that handles all UI requests. For example, MorphicUIHandler, 
MVCUIHandler, RemoteUIHandler, HostWidgetUIHandler, 
TranscripterUIHandler, or even NullUIHandler. At first these classes 
may only handle basic UI modal functionality, ultimately, they would 
have a protocol that handles all UI creation and binding functionality.

 From my point of view, either approach is a reasonable way of 
decoupling model requests for information from the UI layer.

My preference is the second option. As a rule,  I try to avoid 
exceptions if a simple delegation removes the need. I also prefer a 
more intention revealing approach of code that talks to the current UI 
handler who in turn activates the method appropriate for the current 
UI. This is more direct and efficient as an implementation and 
significantly easier for the reader to follow as a sequence of control.

With regard to the immediate test issue, option one only requires the 
catching of the notification, option two requires a custom UI handler 
that admits to interception of UI requests. (This could lead to a UI 
handler that serves as a UI test fixture.)

:-}> John Sarkela


On Tuesday, June 10, 2003, at 08:28 AM, Markus Gaelli wrote:

> Hi,
>
> Adrian and me are doing a little pair-programming for the 
> Squeak-Testserver
> right now, and stumbled over the following:
>
> How can we suppress modal PopupMenus or similar dialogs, when we
> automatically want to build the newest version of the Squeak-Image?
> For example, the newest update gave as a
>
> PopupMenu inform: ' self inform: 'The SqueakMap package catalog system 
> will now be
> installed in the image.  To access SqueakMap, select ''open...''
> from the World menu, then ''Package Loader'' from the submenu.'
>
> which is not good, when we _automatically_ want to integrate the 
> newest code.
>
> What is the best way to circumvent that?
> Do we have to overwrite each possible information-method, while 
> uploading things?
>
> Thanks in advance,
>
> Markus and Adrian
>



More information about the Squeak-dev mailing list