From 9e039e37530f041cba501c2a060c9c9365c0d36d Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Thu, 31 Jul 2003 17:13:42 +0000 Subject: [PATCH] Various testing changes git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@22416 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/demo/run.py | 1 + wxPython/demo/simple.py | 3 +-- wxPython/demo/wxMenu.py | 11 ++++++++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/wxPython/demo/run.py b/wxPython/demo/run.py index 7b83f581fa..560cfb8001 100755 --- a/wxPython/demo/run.py +++ b/wxPython/demo/run.py @@ -18,6 +18,7 @@ on the command line. """ import wx # This module uses the new wx namespace +print "wx.VERSION_STRING = ", wx.VERSION_STRING import sys, os diff --git a/wxPython/demo/simple.py b/wxPython/demo/simple.py index 07a750c639..39cb7d6a5c 100644 --- a/wxPython/demo/simple.py +++ b/wxPython/demo/simple.py @@ -33,7 +33,6 @@ class MyFrame(wx.Frame): sizer.Add(text, 0, wx.ALL, 10) sizer.Add(btn, 0, wx.ALL, 10) panel.SetSizer(sizer) - panel.SetAutoLayout(True) panel.Layout() wx.EVT_BUTTON(self, btn.GetId(), self.OnButton) @@ -47,6 +46,6 @@ class MyFrame(wx.Frame): app = wx.PySimpleApp() frame = MyFrame(None, "Simple wxPython App") -frame.Show(True) +frame.Show() app.MainLoop() diff --git a/wxPython/demo/wxMenu.py b/wxPython/demo/wxMenu.py index c209977197..2cb0ce60e1 100644 --- a/wxPython/demo/wxMenu.py +++ b/wxPython/demo/wxMenu.py @@ -6,7 +6,7 @@ #------------------------------------------------------------------- from wxPython.wx import * - +import images import time #------------------------------------------------------------------- @@ -69,6 +69,11 @@ check the source for this sample to see how to implement them. menuBar.Append(menu4, "Chec&k") menu5 = wxMenu() + # Show how to put an icon in the menu + item = wxMenuItem(menu5, 500, "&Smile!\tCtrl+S", "This one has an icon") + item.SetBitmap(images.getSmilesBitmap()) + menu5.AppendItem(item) + menu5.Append(501, "Interesting thing\tCtrl+A", "Note the shortcut!") menu5.AppendSeparator() menu5.Append(502, "Hello\tShift+H") @@ -107,6 +112,7 @@ check the source for this sample to see how to implement them. EVT_MENU_RANGE(self, 401, 403, self.Menu401To403) + EVT_MENU(self, 500, self.Menu500) EVT_MENU(self, 501, self.Menu501) EVT_MENU(self, 502, self.Menu502) EVT_MENU(self, 503, self.TestRemove) @@ -168,6 +174,9 @@ check the source for this sample to see how to implement them. def Menu401To403(self, event): self.log.write('From a EVT_MENU_RANGE event\n') + def Menu500(self, event): + self.log.write('Have a happy day!\n') + def Menu501(self, event): self.log.write('Look in the code how the shortcut has been realized\n')