April 23, 2024, 01:28:21 PM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


Adding a menu to a dialog

Started by Rock Ridge Farm (Larry), January 10, 2006, 05:23:25 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Rock Ridge Farm (Larry)

I know I am being stupid here but --- I am learning as I go.
I am trying to add a menu to the listview demo.
I added the following to the onInitDialog section:
   menu m;
   m.BeginMenu();
   m.MenuTitle("&File");
   m.MenuItem("Quit",0,1);
   m.MenuTitle("&Options");
   m.MenuItem("Clear",0,2);   
   m.EndMenu();
It compiled but did not display a menu - what did I fail to do?
I assume I failed to associate it properly.

Parker

You have to use the SetMenu function of the window class, which dialog inherits from:
win.SetMenu(m.Detatch());

Rock Ridge Farm (Larry)

Well I guess I need a complete example. I added that then got an error about 'win'.
I moved stuff around but still no luck.

LarryMc

win. needs to be whatever you named your dialog, I think
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Ionic Wind Support Team

Ionic Wind Support Team

Rock Ridge Farm (Larry)