Views.Open kludge!

Marc Martin (marc.martin@msd.ds.boeing.com)
Thu, 06 Jun 1996 11:50:23 -0700

The other day I was commenting on how the Windows version of Oberon/F has
an annoying "feature" in which it refuses to open a new window as large as
my view preference if the view is larger than 6" by 4", even if my main
window is extremely large. Well, after much wasted time experimenting
with the undocumented portions of the framework ("Windows" and
"HostWindows"), I've managed to figure out a workaround. It's not pretty,
but it seems to work.

As you will recall, ideally to open a new view you should only have to do
this:

NEW(v);
Views.Open( v, defLoc, title, NIL );

My workaround so that I can have the window open to larger than 4 by 6" is
this:

NEW(v);
Views.Deposit(v);
StdCmds.Open;
w := Windows.dir.Focus(FALSE);
w.SetTitle( title );
w.SetSize(
RealToInt( viewWidthInches * 96 ) + 12,
RealToInt( viewHeightInches * 96 ) + 12);
HostWindows.Idle;

In addition to this, I have to break my single command into two separate
commands to allow for a "lazy" window update which removes the
unneccessary scroll bars. :-/

Anyone have any suggestions for a better way of doing this?

Thanks!

--
Marc Martin, marc.martin@msd.ds.boeing.com