Re: Application pane size: determining at run time
Robert STRANDH <[email protected]> Fri, 9 Jan 2004 05:35:52 +0100
| Newsgroups | gmane.lisp.clim |
|---|---|
| Message-ID | <[email protected]> |
Paolo Amoroso writes: > Robert STRANDH writes: > > > bounding-rectangle). But you can compute the bounding rectangle of > > the region by using the function bounding-rectangle*. > > > > A better choice would be to use window-viewport which returns the > > visible region of the application pane if it contained in a scroller > > pane, and the sheet region otherwise. > > Consider an application pane that displays some graphics. Its size is > initialized with the :WIDTH and :HEIGHT options, modulo window-manager > dependent constraints. At run time the user can dynamically change the > size of the application frame containing the pane, which in turn may > change the pane's size (or just the visible region?). > > I would like the application-specific graphics to use all the space > available to the pane. So, the pane's display function needs to know > the current size in order to lay out the graphics. If I understand > correctly, WINDOW-VIEWPORT may be used for this if the pane is > contained in a scroller, SHEET-REGION + BOUNDING-RECTANGLE* otherwise. That is not what I meant. WINDOW-VIEWPORT always returns a region, whether the pane is in a scroller pane or not. If it is contained in a scroller pane, it returns the visible region of the pane. Otherwise, it returns the SHEET-REGION of the pane. In both cases, you would use BOUNDING-RECTANGLE* on the resulting region. > Or maybe the display function can use all the space it wants, and the > scroller makes visible a possibly smaller part of the pane's graphics. Yes, there is no limitation to the size of the drawing area (other than the limitations of the representation of coordinates), so you can draw wherever you want. It is the scroller's job to show only as much as will fit in the viewport. -- Robert Strandh --------------------------------------------------------------------- Greenspun's Tenth Rule of Programming: any sufficiently complicated C or Fortran program contains an ad hoc informally-specified bug-ridden slow implementation of half of Common Lisp. --------------------------------------------------------------------- -- [To unsubscribe to this list send an email to "[email protected]" with the following text in the BODY of the message "unsubscribe clim"]