#----------------------------------------------------------------------
-class TestPanel(wx.Window):
+class TestPanel(wx.Panel):
def __init__(self, parent, log, frame=None):
- wx.Window.__init__(
+ wx.Panel.__init__(
self, parent, -1,
style=wx.TAB_TRAVERSAL|wx.CLIP_CHILDREN|wx.NO_FULL_REPAINT_ON_RESIZE
)
self.ie.Navigate(url)
def OnLocationKey(self, evt):
- if evt.KeyCode() == wx.WXK_RETURN:
+ if evt.GetKeyCode() == wx.WXK_RETURN:
URL = self.location.GetValue()
self.location.Append(URL)
self.ie.Navigate(URL)
win = TestPanel(nb, log, frame)
return win
else:
- dlg = wx.MessageDialog(frame, 'This demo only works on Windows.',
- 'Sorry', wx.OK | wx.ICON_INFORMATION)
- dlg.ShowModal()
- dlg.Destroy()
+ from Main import MessagePanel
+ win = MessagePanel(nb, 'This demo only works on Microsoft Windows.',
+ 'Sorry', wx.ICON_WARNING)
+ return win