I originally wrote the program as a command-line text-only beastie, and
am trying to wrap it in wxPython window-dressing, without losing the
ability to run it in a text-only environment.
Is there an approved, cross-platform way for a program to determine if
it can make use of the GUI (something like checking the DISPLAY
envrironment variable, but usable in Linux, Windoze and possibly in the
future BeOS.)
I originally wrote the program as a command-line text-only beastie, and
am trying to wrap it in wxPython window-dressing, without losing the
ability to run it in a text-only environment.
Is there an approved, cross-platform way for a program to determine if
it can make use of the GUI (something like checking the DISPLAY
envrironment variable, but usable in Linux, Windoze and possibly in the
future BeOS.)
I've seen a couple apps use a -nogui command-line flag, but I don't think
there is a standard way to do it automatically.
I have created an application frame, derived from wxFrame. That frame
has a menubar. In the frame, I have put a wxScrolledWindow.
What I want to do is have a the user select a menu item, and have that
event call a method in the scrolled window. The problem is that I have
no idea how to identify the scrolled window, as it doesn't exist when I
create my class from wxFrame. How do I do this?
Save a reference to the window in whatever object has the menu event
handler. Then it is just a matter of calling self.win.method() from within
the event handler.
I originally wrote the program as a command-line text-only beastie, and
am trying to wrap it in wxPython window-dressing, without losing the
ability to run it in a text-only environment.
Is there an approved, cross-platform way for a program to determine if
it can make use of the GUI (something like checking the DISPLAY
envrironment variable, but usable in Linux, Windoze and possibly in the
future BeOS.)
Python try/except
If you can't open a display, then there'll be an exception that you can
catch.