[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: problem with dialog-item border-p

Daniel Berger (berger@SOE.Berkeley.Edu) wrote:
> I create a window and add a button-dialog-item (with border-p nil):
> The button appears with no border.  I then disable the button:
> The button is disabled, but the border appears!
> If I have the window redrawn (cover and the uncover the window),
> the border goes away.
> (The problem occurs with both enabling and disabling.)
> Is this a bug?  Do I have to hack "dialog-item-disable" (i.e. add an
> invalidate-view or something somewhere)?

I've encountered this too.  Before disabling the view, you'll need to
invalidate the dialog-item like so:

   (invalidate-view your-button t)  ; if I recall correctly, 
                                    ; the "t" is needed

This "feature" exists because the view-size for such dialog items is not
constant -- ie, the view-size is enlarged when you enable the border, and
shrunk when you disable it (see the source code in "dialogs.lisp" of the
Additional MCL Sources on the MCL CD).

An alternative workaround is to subclass the dialog-item and then add a before
method for dialog-item-disable (ie, the before method does an invalidate-view
before calling the default method). 

Note that both workarounds may still cause flickering, though.

Hope the above helps.  Perhaps someone else can suggest a neater solution.

Best regards,
JooFung Wong

P.S.  Since I like MCL, the above behavior is probably a "design feature" and
not a bug :-)