Article View: comp.windows.interviews
Article #1140"odd" Button state
From: juando
Date: Tue, 14 May 1991 04:58
Date: Tue, 14 May 1991 04:58
51 lines
2126 bytes
2126 bytes
Playing with alert, I found that if you press and hold any mouse button
outside the screen button and then move the pointer inside it and release, the
button enters an "odd" state: Although no mouse button is pressed, it is
highlighted whenever the pointer enters it. Looking at the code that implements
Button class you can see that it is "swallowing" mouse events. I could fix
that with the patch that follows, but I'm not sure if that is the desired
behavior for Button. Can you tell me if this is right?
Juan.
Apply with patch -p -N at the top level source directory
*** iv/src/lib/IV-look/button.c.orig Thu Jan 24 21:59:00 1991
--- iv/src/lib/IV-look/button.c Mon May 13 21:53:54 1991
***************
*** 60,74 ****
}
void Button::event(Event& e) {
listener_->sensor()->motion(true);
do {
! if (listener_->picks(e.pointer_x(), e.pointer_y())) {
if (telltale_ != nil) {
- telltale_->highlight(true);
- }
- } else {
- if (telltale_ != nil) {
telltale_->highlight(false);
}
}
e.world()->read(e);
--- 60,78 ----
}
void Button::event(Event& e) {
+ if (e.type() != Event::down) {
+ return;
+ }
+ if (telltale_ != nil) {
+ telltale_->highlight(true);
+ }
listener_->sensor()->motion(true);
do {
! if (!listener_->picks(e.pointer_x(), e.pointer_y())) {
if (telltale_ != nil) {
telltale_->highlight(false);
+ listener_->sensor()->motion(false);
+ return;
}
}
e.world()->read(e);
Technical Details
Message-ID:
<"<9105132259.AA23725@cnmus.cnm.us.es>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!sdd.hp.com!elroy.jpl.nasa.gov!decwrl!stanford.edu!cnm.us.es!juandoShow Full Headers
Complete Article Headers
Newsgroups: comp.windows.interviews Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!sdd.hp.com!elroy.jpl.nasa.gov!decwrl!stanford.edu!cnm.us.es!juando From: juando@cnm.us.es Subject: "odd" Button state Message-ID: <"<9105132259.AA23725@cnmus.cnm.us.es> Sender: news@shelby.stanford.edu (USENET News System) Organization: Internet-USENET Gateway at Stanford University Date: Tue, 14 May 1991 04:58:36 GMT Lines: 51