Discussion:
Accessing the wxApp instance?
(too old to reply)
David Dynerman
21 years ago
Permalink
I was wondering what the canonical way of accessing an application
instance.

I couldn't find it browsing the documentation, but is there a global
function that returns the wxApp instance (assuming single-instance)?

If not, is there a clean way to get at the app?

i.e. in OnInit()?

globalInsance = *this;

Thanks for any help.

David

---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-***@lists.wxwidgets.org
For additional commands, e-mail: wx-users-***@lists.wxwidgets.org
Chris Mellon
21 years ago
Permalink
wxGetApp() is defined by the DECLARE_APP macro and returns a pointer
to your derived wxApp class. There is also a global wxApp object
called wxTheApp. See the documentation for wxGetApp().
Post by David Dynerman
I was wondering what the canonical way of accessing an application
instance.
I couldn't find it browsing the documentation, but is there a global
function that returns the wxApp instance (assuming single-instance)?
If not, is there a clean way to get at the app?
i.e. in OnInit()?
globalInsance = *this;
Thanks for any help.
David
---------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-***@lists.wxwidgets.org
For additional commands, e-mail: wx-users-***@lists.wxwidgets.org
David Dynerman
21 years ago
Permalink
Thanks a lot.

Please humor a new guy for a bit longer, but I can't seem to find the
docs.

Presumably this is a function, but on
http://www.wxwindows.org/manuals/2.4.2/wx424.htm#topic1062, the
wxWindows function list, I can't seem to find the function in
question.

david
...
---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-***@lists.wxwidgets.org
For additional commands, e-mail: wx-users-***@lists.wxwidgets.org
Vadim Zeitlin
21 years ago
Permalink
On Mon, 12 Jul 2004 16:08:18 -0500 David Dynerman <***@cs.wisc.edu> wrote:

DD> Please humor a new guy for a bit longer, but I can't seem to find the
DD> docs.

http://www.lpthe.jussieu.fr/~zeitlin/wxWindows/docs/wxwin_appinifunctions.html#wxgetapp

HTH,
VZ


---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-***@lists.wxwidgets.org
For additional commands, e-mail: wx-users-***@lists.wxwidgets.org
Chris Mellon
21 years ago
Permalink
Apparently it's not in the 2.4.2 docs (although it does exist, I
promise ;)) It is in the 2.5.x docs. It's mentioned in the wxApp
overview. Maybe someone could backport this doc change?
...
---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-***@lists.wxwidgets.org
For additional commands, e-mail: wx-users-***@lists.wxwidgets.org
Ryan Norton
21 years ago
Permalink
Post by Chris Mellon
wxGetApp() is defined by the DECLARE_APP macro and returns
a pointer
Post by Chris Mellon
to your derived wxApp class. There is also a global wxApp
object
Post by Chris Mellon
called wxTheApp. See the documentation for wxGetApp().
wxTheApp is depreciated though :).

Ryan


---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-***@lists.wxwidgets.org
For additional commands, e-mail: wx-users-***@lists.wxwidgets.org
Loading...