jcc@adesign.uucp (Jean Christophe) (09/08/90)
Hello folks, Again my friend badly needs help with CommomView. It *seems* that the function Menu::DeleteItem doesn't work properly. But she suspects that she's doing something wrong... Here is the sympton : class MyWind : public TopAppWindow { Menu menu; Menu menubar; public: MyWind(); virtual void MenuCommand(MenuCommandEvt); }; MyWind::MyWind() { menu.AppendItem(1, "line 1"); menu.AppendItem(2, "line 2"); menubar.AppendItem(&menu, "Menu 1"); ChangeMenu(&menubar); Show(); } void MyWind::far MenuCommand(MenuCommandEvt e) { switch(e.GetItemID()) { case 1: /* This function call fails... And the menu is still there and active */ menubar.DeleteItem(&menu); break; } } Anybody gets an idea why this won't work ? Since the CommonView documentation seems to be a pain, my friend needs some more elaborate examples. More precisely, programs that deal with the classes : ChildAppWindow, Menu, DialogWindow, ListBox... If you have such small examples to share, she would be very gratefull and very relieved. Note : this is done with C++ 1.2 and I suspect the version of CommonView to be somehow out of date... Reply by Email please. Thanx in advance, -- "Jessie" ------------------------------------------------------------------------------ jcc@adesign.uucp | "An artificial intelligence is better than none!" ..!inria!adesign!jcc | "Artificial intelligence matches natural stupidity!" Collet Jean-Christophe | "Objets inanimes avez-vous donc une ame ?" ------------------------------------------------------------------------------ Axis Design | 119, rue de Flandres | 75019 Paris | <this space left intentionaly blank> France | Tel: +33 (1) 40 35 20 20 | ------------------------------------------------------------------------------