Ecere SDK/eC Forums
http://ecere.org/community/
Print view

Something in eNotepad example
http://ecere.org/community/viewtopic.php?f=5&t=378
Page 1 of 1
Author:  samsam598 [ Thu Oct 17, 2013 1:51 am ]
Post subject:  Something in eNotepad example

Given below code:

Code: Select all

 
Menu fileMenu { menu, "File", f };
 
At the place both menu and f has not defined but how come they are ready to use?I am a bit confused to the construction of the Menu system in eC.
Author:  jerome [ Thu Oct 17, 2013 4:20 pm ]
Post subject:  Re: Something in eNotepad example

Hi Sam,

First this is equivalent to:

Code: Select all

Menu fileMenu { parent = menu, text = "File", hotKey = f };
Then 'menu' here if this is inside a Window class would refer to the Window::menu property of that class, which is automatically initialized when you set hasMenuBar = true.

'f' in this case is an enumeration value from KeyCode which can be converted to the data type of the Window::hotKey property (Key).

Hope this helps :)

-Jerome
All times are UTC-05:00 Page 1 of 1