document list using RadioMenuItems



Hi all,

I am trying to implement a list of open documents in a menu: the files are listed in a menu (accessed from the main menu bar) as RadioMenuItems. The file currently displayed is the one that is selected in the menu, and the list can be manipulated as run-time (i.e. documents can be opened/closed). I suppose this is a little bit MDI-like, but in my case only one document is displayed at any time (in order to preserve resources - this is an OpenGL application).

I'm having a few problems implementing this cleanly. I should say that I'm using the Menu_Helpers interface, since the UIManager interface makes it difficult to modify the menu structure at runtime. My problems are mainly to do with handling signals & callbacks. When the list is initially empty (i.e. there is no actual RadioButtonGroup), the signal_toggled() method is not emitted when the first item is added to the list. Also, in the callback itself, I'm having to check whether the callback was emitted for the RadioMenuItem that was actually selected, rather than the one that was just de-selected. All this is not too difficult to work around, but it isn't the most elegant code I've ever written...

So my question is: is there an easy, already worked-out solution for this? I'm assuming there are many applications that use a drop-down list of documents that are currently open, with the one that is currently under focus being highlighted. Does anyone have a neat solution?


Thanks for your help!

Donald.
begin:vcard
fn:Jacques-Donald Tournier
n:Tournier;Jacques-Donald
org:;Brain Research Institute
adr:Austin Health, Banksia Street, Heidelberg West;;Neurosciences Building;Melbourne;VIC;3081;Australia
email;internet:d tournier brain org au
title:Research Fellow
tel;work:+61 3 9496 4169
tel;fax:+61 3 9496 4071
version:2.1
end:vcard



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]