Article View: comp.windows.interviews
Article #133Re: HELP: patches and buttons
From: Doug Pan
Date: Wed, 29 Jul 1992 11:50
Date: Wed, 29 Jul 1992 11:50
47 lines
2261 bytes
2261 bytes
In article <15580@star.cs.vu.nl> ben@cs.vu.nl (Bruschke BAH) writes:
Path: leland.Stanford.EDU!stanford.edu!ames!olivea!uunet!mcsun!sun4nl!star.cs.vu.nl!ben@cs.vu.nl
From: ben@cs.vu.nl (Bruschke BAH)
Newsgroups: comp.windows.interviews
Date: 28 Jul 92 09:39:36 GMT
Sender: news@cs.vu.nl
Organization: Fac. Wiskunde & Informatica, Vrije Universiteit, Amsterdam
Lines: 19
> We made a box that contains buttons. This box can variate in size during the
> execution of the program in which it is used. Therefor we made it a patch, so
> it can be reallocated and redrawn. We believe that we call reallocate and
> redraw at the right moments because when for example we have a box with 5
> buttons and empty this box and fill it with 7 buttons, these 7 buttons are
> correctly displayed. The problem is however that the last two buttons in this
> example can't be pressed (i.e. if we click on one of the last two buttons,
> WHICH ARE OUTSIDE THE AREA WHICH WAS OCCUPIED BY THE 5 ORIGINAL BUTTONS,
> press() isn't called).
Three points to consider:
1) Did you call Box::modifed(GlyphIndex) after inserting the new
glyphs?
2) If you subclassed from InputHandler and redefined allocate(), you
should call InputHandler::allocate from the redefined version:
DerivedInutHandler::allocate(
Canvas* c, const Allocation& a, Extension& e
) {
...
InputHandler::allocate(c, a, e);
...
}
otherwise, the InputHandler would not know that the extension was
changed.
Note: More often, one should redefine
InputHandler::allocation_changed rather than
InputHandler::allocate.
3) Wrap any glyph in doubt with DebugGlyph and inspect the actual
allocations.
--Doug
Technical Details
Message-ID:
<PAN.92Jul29115041@panda.Stanford.EDU>Path:
arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!leland.Stanford.EDU!leland!panReferences:
<15580@star.cs.vu.nl>Show Full Headers
Complete Article Headers
Newsgroups: comp.windows.interviews Path: arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!leland.Stanford.EDU!leland!pan From: pan@panda.Stanford.EDU (Doug Pan) Subject: Re: HELP: patches and buttons In-Reply-To: ben@cs.vu.nl's message of 28 Jul 92 09:39:36 GMT Message-ID: <PAN.92Jul29115041@panda.Stanford.EDU> Sender: news@leland.Stanford.EDU (Mr News) Organization: Stanford University References: <15580@star.cs.vu.nl> Date: 29 Jul 92 11:50:41 Lines: 49