Misachi
Misachi

Reputation: 81

wxPython produces no GUI output

Am new to GUI with wxPython.Was trying out this block of code from a book and it produces the following output but no GUI with the message string.Here's the code..

Here's the code

And Here's the output

Upvotes: 0

Views: 50

Answers (1)

RobinDunn
RobinDunn

Reputation: 6206

Python is case-sensitive and you need to use an uppercase 'O' in OnInit.

import wx

class MyApp(wx.App):
    def OnInit(self):
        wx.MessageBox('Hello Brian', 'wxApp')
        return True

app = MyApp()
app.MainLoop()

Upvotes: 1

Related Questions