Re: trouble with wxPython intro



On May 30, 11:41 pm, Anthony Irwin <nos...@xxxxxxxxxxxxxxxxxxx> wrote:
Daniel Gee wrote:
I'm trying to learn WxPython with the tutorial:
http://wiki.wxpython.org/Getting_Started


I'm a wxPython beginner too, but instead of Anthony Irwin's
suggestions, I think you should delete these two lines:

ID_ABOUT=101
ID_EXIT=110

and use:

wx.ID_ABOUT
wx.ID_EXIT

throughout the body of your program. As far as I can tell, there is
no reason for you to be manually setting your own id's (is there
ever?). Instead, you can use the ids in the wx module.

In addition, I suggest you never use wx.PySimpleApp(). If you create
your own app class, you can send the error messages to the console.
Instead of always seeing a window that flashes at you briefly and
being left with no clue what went wrong, you can at least see an error
message and a line number in the console. Here's how you would do
that:

-----------------
import wx

class MyFrame(wx.Frame):
def __init__(self, mytitle):
wx.Frame.__init__(self, None, title= mytitle)

class MyApp(wx.App):
def __init__(self):
wx.App.__init__(self, redirect=False)

app = MyApp()

window = MyFrame("Testing")
window.Show()

app.MainLoop()

------------------

By setting redirect=False in wx.App.__init__(), the errors will be
sent to the console.

.



Relevant Pages

  • Re: working set and console applications
    ... I created a windows application and then I created a child console process ... that I started from the parent process using CreateProcess. ... I minimize the child console window it also causes the working set of the ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Console applications window size
    ... AllocConsole() or AttachConsole. ... You already have a console, ... SMALL_RECT srWindowRect; // hold the new window size ... >exe from a cmd prompt, the same cmd prompt gets bigger properly. ...
    (microsoft.public.vc.language)
  • Re: How to minimize command mode window in console program?
    ... to set some property to minimize the console window. ...     ByVal hWnd As IntPtr, ...     End Sub ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Prevent Domain Users From Browsing Around in Active Directory?
    ... View, Customize, uncheck everything except the top one that says Console ... But they will have the rt-click feature. ... Rt-click on that OU, new window from here. ...
    (microsoft.public.windows.server.active_directory)
  • Re: vb6 run from and output to command window
    ... VB doesn't really create true console applications (because the linker ... allocate the console window, and read/write from/to it. ... Private Declare Function AllocConsole Lib "kernel32" As Long ... Dim lResult As Long ...
    (microsoft.public.vb.general.discussion)