Wimp question
Dave J Lawrence1
DLAWRENC at uk.ibm.com
Wed Aug 1 18:22:15 BST 2001
Stefan,
This might be of relevance, it is a sequence of postings to c.s.a.p
initiated by me when I wanted to reduce an open window's size. Have a look
and see if it is any use [I have pruned is severely so as to shorten the
email]. As OSLib is such a thin veneer I think that you will always find
that any problems that I have lie in the OS, not in the calling veneer -
it's worth bearing in mind for next time ;-)
Message 1 in thread
From: Dave Lawrence (djlawrence at my-deja.com)
Subject: WIMP Window Extents
Newsgroups: comp.sys.acorn.programmer
Date: 2000/06/23
A question for those more knowledgeable in WIMP programming than myself:
My app is written in C++ and uses OSLib, but I believe that this
question is generic to WIMP programming.
If I use the OSLib function xwindow_set_extent to set the extent of a
window currently displayed on the screen to set the extent to less that
the currently visible area, the WIMP does not detect that the window
frame needs redrawing - I can (and do) cause the window contents to
refresh, but the non-existent part of the window is left on the screen.
If I click (but don't even move) the mouse on the resize window
control, the window frame is immediately redrawn by the WIMP with the
correct extent.
My question is - can I get the wimp to do this when the
xwindow_set_extent is called or do I have to faff around with doing the
check myself, getting window data, modifying the data to reflect the
new window size and setting the window data to the correct size. It
seems an awful waste for the WIMP to already have this code (shown by
the correct redraw when I click on the resize control) and for me to
have to duplicate it.
Message 2 in thread
From: Stewart Brodie (stewart.brodie at pace.co.uk)
Subject: Re: WIMP Window Extents
Newsgroups: comp.sys.acorn.programmer
Date: 2000/06/23
Try: Wimp_GetWindowState, Wimp_CloseWindow (or Wimp_OpenWindow behind
the backdrop), Wimp_SetExtent, Wimp_OpenWindow using the state from the first
call to Wimp_GetWindowState.
I didn't think it was permitted to shrink the extent of a window such that
currently visible portions were outside the extent.
Message 3 in thread
From: Ben Avison (ben.avison at pace.co.uk)
Subject: Re: WIMP Window Extents
Newsgroups: comp.sys.acorn.programmer
Date: 2000/06/23
As far as I can remember, the window extent is only taken into account the
next time you call Wimp_OpenWindow, so all you need do is Wimp_SetExtent,
Wimp_GetWindowState, and Wimp_OpenWindow with the block returned from
Wimp_GetWindowState.
> I didn't think it was permitted to shrink the extent of a window such that
> currently visible portions were outside the extent.
There are no checks in Wimp_SetExtent that the new extent is all visible,
so yes, it's permitted.
Message 4 in thread
From: Dave Lawrence (djlawrence at my-deja.com)
Subject: Re: WIMP Window Extents
Newsgroups: comp.sys.acorn.programmer
Date: 2000/06/23
Using your suggested sequence of calls, will the window flicker as I
close and then reopen it? If I did Wimp_GetWindowState, calculate new
maximim size of window, Wimp_SetWindowState limiting size to the about-
to-be-set extent, Wimp_SetExtent, would that be flicker free?
As I said in my original posting, the Wimp is happy to resize my window
to keep it in step with the extent when I touch the resize control,
it's a pity it doesn't do this automatically when the extent is set.
> I didn't think it was permitted to shrink the extent of a window such
> that currently visible portions were outside the extent.
It may not be permitted, but it didn't return an error when I did it.
Message 6 in thread
From: Ian Bannister (bannisteri at argonet.co.uk)
Subject: Re: WIMP Window Extents
Newsgroups: comp.sys.acorn.programmer
Date: 2000/06/23
In the current version maybe.
The documentation for RISC OS 3 says that the call Wimp_SetExtent cannot be
used to resize a window's visible area and that no part of the visible area
must be made to lie outside the new extent. It is not permitted in that
respect and could be expected to cause undefined behaviour as the original
poster found. Wimp_OpenWindow is the legal way of making a window change
size or scroll.
Best of luck,
Dave Lawrence
More information about the oslib-user
mailing list