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 #----------------------------------------------------------------------------