Something in eNotepad example

General help with the Ecere Cross Platform GUI toolkit: Window, common controls, events, etc.
Help with the 2D Graphics library: Surface, Display, Bitmap, Font and others.
Post Reply
Posts: 212
Joined: Thu Apr 14, 2011 9:44 pm

Something in eNotepad example

Post by samsam598 »

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.
Site Admin
Posts: 608
Joined: Sat Jan 16, 2010 11:16 pm

Re: Something in eNotepad example

Post by jerome »

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 :)

Post Reply