 
       wx.lib.agw.toasterbox.ToasterBox¶
  wx.lib.agw.toasterbox.ToasterBox¶ToasterBox is a cross-platform widget to make the creation of MSN style “toaster” popups easier.
 Methods Summary¶
 Methods Summary¶| __init__ | Default class constructor. | 
| AddPanel | Adds a panel to the ToasterBox. | 
| CenterOnParent | Centres the window on its parent (if any). If the ToasterBoxparent isNone, | 
| CenterOnScreen | Centres the ToasterBoxon screen. | 
| CleanList | Cleans the window list, erasing the stack of ToasterBoxobjects. | 
| GetToasterBoxWindow | Returns the ToasterBoxframe. | 
| GetUseFocus | Returns whether ToasterBoxwill steal the focus from the parent application. | 
| MoveAbove | If a ToasterBoxalready exists, move the new one above the existing one. | 
| Notify | It’s time to hide a ToasterBox. | 
| OnMoveTimer | Handles the wx.EVT_TIMERevent forToasterBox, moving the new window | 
| Play | Creates the ToasterBoxWindow, that does all the job. | 
| SetPopupBackgroundColour | Sets the ToasterBoxbackground colour. | 
| SetPopupBitmap | Sets the ToasterBoxbackground image. | 
| SetPopupPauseTime | Sets the time after which the ToasterBoxis destroyed (linger). | 
| SetPopupPosition | Sets the ToasterBoxposition on screen. | 
| SetPopupPositionByInt | Sets the ToasterBoxposition on screen, at one of the screen corners. | 
| SetPopupScrollSpeed | Sets the ToasterBoxscroll speed. | 
| SetPopupSize | Sets the ToasterBoxsize. | 
| SetPopupText | Sets the ToasterBoxtext label. | 
| SetPopupTextColour | Sets the ToasterBoxforeground colour. | 
| SetPopupTextFont | Sets the ToasterBoxtext font. | 
| SetTitle | Sets the ToasterBoxtitle if it was created withTB_CAPTIONwindow style. | 
| SetUseFocus | If focus is True, InstructsToasterBoxto steal the focus from the | 
 Class API¶
 Class API¶ToasterBox(wx.Timer)¶ToasterBox is a cross-platform widget to make the creation of MSN style “toaster” popups easier.
__init__(self, parent, tbstyle=TB_SIMPLE, windowstyle=TB_DEFAULT_STYLE, closingstyle=TB_ONTIME, scrollType=TB_SCR_TYPE_DU)¶Default class constructor.
| Parameters: | 
 | 
|---|
AddPanel(self, panel)¶Adds a panel to the ToasterBox.
| Parameters: | panel – an instance of wx.Window. | 
|---|
Note
Use this method only for a ToasterBox created with the TB_COMPLEX style.
CenterOnParent(self, direction=wx.BOTH)¶Centres the window on its parent (if any). If the ToasterBox parent is None,
it calls CenterOnScreen.
| Parameters: | direction – specifies the direction for the centering. May be wx.HORIZONTAL,wx.VERTICALorwx.BOTH. | 
|---|
Note
This methods provides for a way to center ToasterBox over their parents instead of the
entire screen. If there is no parent, then behaviour is the same as CenterOnScreen.
See also
CenterOnScreen(self, direction=wx.BOTH)¶Centres the ToasterBox on screen.
| Parameters: | direction – specifies the direction for the centering. May be wx.HORIZONTAL,wx.VERTICALorwx.BOTH. | 
|---|
See also
CleanList(self)¶Cleans the window list, erasing the stack of ToasterBox objects.
GetToasterBoxWindow(self)¶Returns the ToasterBox frame.
GetUseFocus(self)¶Returns whether ToasterBox will steal the focus from the parent application.
MoveAbove(self, tb)¶If a ToasterBox already exists, move the new one above the existing one.
| Parameters: | tb – another instance of ToasterBox. | 
|---|
Notify(self)¶It’s time to hide a ToasterBox.
OnMoveTimer(self, event)¶Handles the wx.EVT_TIMER event for ToasterBox, moving the new window
on top of the last one created.
| Parameters: | event – a TimerEventevent to be processed. | 
|---|
Play(self)¶Creates the ToasterBoxWindow, that does all the job.
SetPopupBackgroundColour(self, colour=None)¶Sets the ToasterBox background colour.
| Parameters: | colour – a valid wx.Colourobject. If defaulted toNone, then
the background colour will be white. | 
|---|
Note
Use this method only for a ToasterBox created with the TB_SIMPLE style.
SetPopupBitmap(self, bitmap=None)¶Sets the ToasterBox background image.
| Parameters: | bitmap – a valid wx.Bitmapobject or filename. If defaulted
toNone, then no background bitmap is used. | 
|---|
Note
Use this method only for a ToasterBox created with the TB_SIMPLE style.
SetPopupPauseTime(self, pausetime)¶Sets the time after which the ToasterBox is destroyed (linger).
| Parameters: | pausetime – the delay after which the control is destroyed, in seconds. | 
|---|
SetPopupPosition(self, pos)¶Sets the ToasterBox position on screen.
| Parameters: | pos – the widget position, an instance of wx.Point. | 
|---|
SetPopupPositionByInt(self, pos)¶Sets the ToasterBox position on screen, at one of the screen corners.
| Parameters: | pos – an integer specifying the screen corner, namely: 
 | 
|---|
SetPopupScrollSpeed(self, speed)¶Sets the ToasterBox scroll speed.
| Parameters: | speed – it is the pause time (in milliseconds) for every step in the ScrollUp method. | 
|---|
SetPopupSize(self, size)¶Sets the ToasterBox size.
| Parameters: | size – the new control size, an instance of wx.Size. | 
|---|
SetPopupText(self, text)¶Sets the ToasterBox text label.
| Parameters: | text – the widget label. | 
|---|
Note
Use this method only for a ToasterBox created with the TB_SIMPLE style.
SetPopupTextColour(self, colour=None)¶Sets the ToasterBox foreground colour.
| Parameters: | colour – a valid wx.Colourobject. If defaulted toNone, then
the background colour will be black. | 
|---|
Note
Use this method only for a ToasterBox created with the TB_SIMPLE style.
SetPopupTextFont(self, font=None)¶Sets the ToasterBox text font.
| Parameters: | colour – a valid wx.Colourobject. If defaulted toNone, then
a simple generic font will be generated. | 
|---|
Note
Use this method only for a ToasterBox created with the TB_SIMPLE style.
SetTitle(self, title)¶Sets the ToasterBox title if it was created with TB_CAPTION window style.
| Parameters: | title – the ToasterBoxcaption title. | 
|---|
SetUseFocus(self, focus)¶If focus is True, Instructs ToasterBox to steal the focus from the
parent application, otherwise it returns the focus to the original owner.
| Parameters: | focus – Trueto set the focus onToasterBox,Falseto
return it to the original owner. | 
|---|