[haiku-development] Could this code have ever workk?

  • From: julun <host.haiku@xxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Wed, 10 Sep 2008 21:42:59 +0200

Hi,

i was looking into ArtPaint's code while the 'Zoom Canvas' slider does not work as it should. Now I've stumbled about a piece of code that looks suspicious to me:

void
PopUpSlider::Go()
{
        Show();
        PostMessage(B_MOUSE_DOWN, fSlider);
        PostMessage(B_QUIT_REQUESTED, this);
}


PopUpSlider is derived from BWindow, which was constructed like this:

PopUpSlider::PopUpSlider(BRect rect)
        : BWindow(rect, "popUpSliderWindow", B_BORDERED_WINDOW_LOOK,
                B_FLOATING_APP_WINDOW_FEEL, 0)


There is also an static instantiate function inside the PopUpSlider class, which creates and the adds the BSlider to the window etc.


Now the strange thing, the Go() function is called from inside an event filter with this signature:

filter_result filter(BMessage *message,BHandler **handlers,BMessageFilter *filter)

The filter reacts on B_MOUSE_DOWN messages, set on a given view. In BeOS the code works the following, on mouse down the filter get's called, the window opens and stays open until i release the mouse. In Haiku the window opens for a fraction of a second and hides then immediately. Any idea how or why this could have ever worked on BeOS?


Thanks for your time,
Karsten

Other related posts: