[haiku-development] Help regarding Dynamic Menu in Tracker

  • From: Hrishi Hiraskar <hrishihiraskar@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Thu, 26 Apr 2018 12:30:46 +0000

Hie

For my GSoC project, I'm experimenting with creating a Dymanic menu which
will be added to the Tracker's Root Menu be an addon.

I was able to pass the BMenu pointer in order to populate menu and I was
also able to populate menu.
But I wasn't able to do implement what happens on clicking the menu item.
(Basically on click event of the items added).

I first created a  Fake Window and overrided it's MessageReceived function
to call my function. And then SetTarget of menu to this window.
This didn't work.

Then I created a class inherited from BMenu and overrided the
MessageReceived function. And SetTargetForItems as this.
This also didn't work.

In both the cases, MessageReceived is not being called. I think I'm missing
something.

The modified haiku source is at https://github.com/Hrily/haiku
The modified file is
https://github.com/Hrily/haiku/blob/1bee79120528742e33727f694d021d6b350bb181/src/kits/tracker/ContainerWindow.cpp#L182

The source for addon is at https://github.com/Hrily/haiku_addon

Thank  you

Regards
Hrishikesh Hiraskar

Other related posts: