tags:

views:

18

answers:

1

The constructor for a stock ImageMenuItem requires an AccelGroup. I think I should use the main Window's AccelGroup, but I'm not sure how to get it.

Edit: It turns out you can use the Stock Enum in ImageMenuItem (string label), not just in ImageMenuItem (string stockId, AccelGroup accelGroup). So I don't really need to get the Window's AccelGroup after all. Still, it would be nice to know for future reference.

+1  A: 

You can use the Accel class

AccelGroup glist[] = Accel.GroupsFromObject(mywindow);
IanNorton
I accepted this because it answered the question that I asked, but I ended up just doing `new ImageMenuItem (stockId, null)`.
Matthew