2 #----------------------------------------------------------------------------
4 # Purpose: Testing wxTaskBarIcon for win32 systems
10 # Copyright: (c) 1998 by Total Control Software
11 # Licence: wxWindows license
12 #----------------------------------------------------------------------------
15 from wxPython
.wx
import *
18 #---------------------------------------------------------------------------
20 class MyDialog(wxDialog
):
22 wxDialog
.__init
__(self
, NULL
, -1, "wxTaskBarIcon Test",
23 wxPoint(-1,-1), wxSize(380,250),
24 wxDIALOG_MODELESS|wxDEFAULT_DIALOG_STYLE
)
26 # build the contents of the Dialog
27 wxStaticText(self
, -1,
28 "Press OK to hide me, Exit to quit.",
30 wxStaticText(self
, -1,
31 "Double-click on the taskbar icon to show me again.",
34 okButton
= wxButton(self
, wxID_OK
, "OK", wxPoint(100, 180), wxSize(80, 25))
35 exitButton
= wxButton(self
, wxID_EXIT
, "Exit", wxPoint(185, 180), wxSize(80, 25))
39 EVT_BUTTON(self
, wxID_OK
, self
.OnOK
)
40 EVT_BUTTON(self
, wxID_EXIT
, self
.OnExit
)
43 # make the TaskBar icon
44 self
.tbIcon
= wxTaskBarIcon()
45 icon
= wxIcon('bitmaps/smiles.ico', wxBITMAP_TYPE_ICO
)
46 self
.tbIcon
.SetIcon(icon
, "Test ToolTip")
47 EVT_TASKBAR_LEFT_DCLICK(self
.tbIcon
, self
.OnTaskBarActivate
)
51 def OnTaskBarActivate(self
, event
):
54 def OnOK(self
, event
):
57 def OnExit(self
, event
):
60 def OnCloseWindow(self
, event
):
62 del self
.tbIcon
# ensure the tbIcon is cleaned up...
66 #---------------------------------------------------------------------------
72 self
.SetTopWindow(self
.dlg
)
75 #---------------------------------------------------------------------------
87 if __name__
== '__main__':
91 #----------------------------------------------------------------------------
94 # Revision 1.2 1998/12/15 20:44:36 RD
95 # Changed the import semantics from "from wxPython import *" to "from
96 # wxPython.wx import *" This is for people who are worried about
97 # namespace pollution, they can use "from wxPython import wx" and then
98 # prefix all the wxPython identifiers with "wx."
100 # Added wxTaskbarIcon for wxMSW.
102 # Made the events work for wxGrid.
106 # Added wxMiniFrame for wxGTK, (untested.)
108 # Changed many of the args and return values that were pointers to gdi
109 # objects to references to reflect changes in the wxWindows API.
111 # Other assorted fixes and additions.
113 # Revision 1.1 1998/11/25 08:47:12 RD
115 # Added wxPalette, wxRegion, wxRegionIterator, wxTaskbarIcon
116 # Added events for wxGrid
117 # Other various fixes and additions