Author Topic: Where is the OnInit code section when wxSmith is used to add new Dialog/Frame?  (Read 3539 times)

Offline tvaster

  • Multiple posting newcomer
  • *
  • Posts: 20
I need to set the date inside a newly opened Dialog.

I see the OnInit code section on the base frame in the xxxxApp.cpp file and that works fine on launch,  but when I use use wxSmith to create a new Dialog or Frame, there is no OnInit to be found in the new xxxx.cpp or xxxx.h files.  I can manually add it in the new "class", but it never gets called.

Can somebody point me in the right direction.  Everything else in the new Dialog works as it should. I even thought of using the Timer for this but that is certainly a waste of resources.  There must be a simpler way.

Fred V.


Offline wobien

  • Multiple posting newcomer
  • *
  • Posts: 69
Do you want to add code that will run when your new Dialog or Frame is launched, or code that will launch the new window?
If you mean the first, you can add your code in the constructor of the class.
Just be carefull not to add any code between
Code
//(*Initialize(xxxDialog)
and
Code
//*)
because that is the part that is managed by wxSmith.

Offline tvaster

  • Multiple posting newcomer
  • *
  • Posts: 20
Quote
Do you want to add code that will run when your new Dialog or Frame is launched
Yes and your suggestion works fine
Thank you very much.
« Last Edit: January 06, 2008, 07:25:08 pm by tvaster »