Ecere SDK/eC Forums http://ec-lang.org/community/ Print view |
|
What does the main() look like? http://ec-lang.org/community/viewtopic.php?f=1&t=165 |
Page 1 of 1 |
Author: | samsam598 [ Wed Aug 24, 2011 5:33 am ] |
Post subject: | What does the main() look like? |
I am wondering what the main() funtion has been organized?Is it something like below? Code: Select all
Thanks. |
Author: | jerome [ Wed Aug 24, 2011 11:57 am ] |
Post subject: | Re: What does the main() look like? |
When you import Ecere, you pick up a default GUI Application class, called GuiApplication. If you want to define your own Main() (declared as a virtual function in Application), or override Init(), Cycle() or Terminate(), you need to define your own Application/GuiApplication class. e.g. a console Hello World would be: Code: Select all
Code: Select all
GuiApplication provides a default Main() method that creates all windows (unless their autoCreate property is set to false), and then run a GUI loop until no more windows are left. If you override it, you lose this automatic functionality, so you have to make sure to put in your own loop, or chain to GuiApplication::Main(). Here is a very basic Main loop: Code: Select all
Regards, Jerome |
All times are UTC-05:00 | Page 1 of 1 |
Powered by phpBB® Forum Software © phpBB Limited |