[haiku-development] Re: Calling BPopUpMenu.Go() causes BView not to receive MouseMoved notifications

  • From: "Mauro de Wit" <maurodewit@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Thu, 15 Jan 2009 19:55:43 +0000

When I call it as asynchronous it still causes my view to be "defocussed",
causing the MouseMoved to be triggered as B_EXITED_VIEW. As I explained I
want to close the menu when the mouse exits, causing the Popup to be
destroyed, thus giving the focus back to my view causing B_ENTERED_VIEW to
be triggered and the popup is opened again. This results in a nice loop with
a flickering popup :-)

Maybe I should not use the BPopupMenu in this case. I'm looking for
something like the labels that popup when you hover an item on the Windows
taskbar.
Is there some class suitable for this?

On Thu, Jan 15, 2009 at 7:44 PM, Stephan Aßmus <superstippi@xxxxxx> wrote:

> Mauro de Wit schrieb:
>
>  Hello,
>>
>> I have a BView which triggers a BPopUpMenu to pop up when the mouse enters
>> the view.
>> As a result the PopupMenu shows and my view no longer receives MouseMoved
>> messages.
>>
>> Is there a way to force the messaging system to keep notifying my view for
>> MouseMoved events?
>> I want to hide the popup menu when the mouse leaves the view.
>>
>
> You need to tell the menu that it's asynchronous, then your window thread
> will not block in the Go() call. I would not recommend to change the usual
> behavior of popup menus if you do not have a very good reason for it. That's
> not to say you should not use an asynchronous popup. Just don't force close
> it by yourself, unless you have a very specific use case.
>
> Best regards,
> -Stephan
>
>
>

Other related posts: