[openbeos] Re: Need help with BColumListView

  • From: Michael Pfeiffer <michael.w.pfeiffer@xxxxxxxxx>
  • To: openbeos@xxxxxxxxxxxxx
  • Date: Tue, 14 Aug 2007 16:03:44 +0200


Am 14.08.2007 um 15:59 schrieb Fredrik Modéen:



Am 14.08.2007 um 14:38 schrieb Fredrik Modéen:

thanks that helpt #2 :)

Are you any good on BPopupMenu?

I have a derived BListView where I with MouseDown shows a popupmenu
but I
can't catch/find the message sent from that menu. In the derived
BListView
I have MessageReceived and I have that in that's parent Window as well
but no message.

BMenu::SetTargetForItems(BHandler *handler) should do the trick.
like this?
This are from the derived BListView constructor.
        popupmenu = new BPopUpMenu("Torrent");
popupmenu->AddItem(new BMenuItem("Get Info", new BMessage (TR_INFO), 'I',
B_COMMAND_KEY));
        popupmenu->FindItem(TR_INFO)->SetEnabled(false);
        popupmenu->AddSeparatorItem();
        popupmenu->AddItem(new BMenuItem("Resume", new BMessage(TR_RESUME)));
        popupmenu->AddItem(new BMenuItem("Pause", new BMessage(TR_PAUSE)));
        popupmenu->AddItem(new BMenuItem("Remove", new BMessage(TR_REMOVE)));
        popupmenu->SetTargetForItems(new BHandler("test"));

Didn't work.
Have MessageReceived derived in the app class windows class and BListView
class but no message are passed.

Yes, except replace "new BHandler(...)" with the pointer to your window.

- Michael

Other related posts: