by Igor2
As described in the previous post, pcb-rnd will feature dynamic menus. I first implemented this in the gtk hid.
It turned out gtk was way too OOP for my taste1. It took about 6 hours total, to implement and debug the feature. (As a comparison, it took about 90 minutes to make the research related to the resource structs in PCB and implement the HID modifications for the new hid command). The trickiest part was to figure the need of calling a show() on the menubar after adding the new items.
When I didn't have that, only plain action menu/submenus showed up (in already existing menu/ widgets), but new (main) menus and menu/submenu/submenus didn't. After many hours of gdb sessions I finally made sure (by printing all the widgets to stderr recursively) that: