Opening and Closing views

From: [at]} <Stewart>
Date: Thu, 19 Aug 1999 10:51:46

Hi Folks,

I have a model/view for controlling a device attached to a serial port.
Basically, its a simple terminal with set number of lines buffered for
display. I want it to behave similar to the standard Log view. That is, the
user may open or close it, but there is one copy open at a time. So I tried
this:

PROCEDURE Open*;
BEGIN
  NEW(termView);
  termView.model := termModel;
  Views.Open(termView, Files.dir.This(""), "Terminal", NIL);
END Open;

I have only one copy of the model. Each time Open is called, it displays a
new view attached to the same model. Presumably, since the framework knows
that the new view has the same name and location as the old view, it should
not open a new window if one already exists.

It works up to a point. Once the first view is opened, more calls to Open
will not open another view. However, after CLOSING the initial view, every
call to Open gives a new window. The first one has title "Terminal",
successive ones have title "<Terminal>", so it presumably realises they are
the same. Is there a better way of doing this? All I want is an effect
similar to StdLog.Open.


Another problem is that I get "Terminal has changed. Do you want to save
changes?" when closing the window. This seems to be related to the use of
UpdateMsg in the model. If I don't send UpdateMsgs, it doesn't ask the
question. Is there a way of telling the framework that I don't want to save
the view, even though I have updated its model?


Cheers,
- Stewart


To unsubscribe from this mailing list, send a message containing the word "unsubscribe" to:
   blackbox-request{([at]})nowhere.xy

To get a list of valid e-mail commands and instructions on their usage, send a message containing the word "help" to the above address.

Send any problem reports or questions to:
   owner-blackbox{([at]})nowhere.xy
Received on Thu Aug 19 1999 - 04:45:03 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:27:43 UTC