Hi Ron,
Hi,
I wanted to use ToasterBox, but
my application does not behave as the inline
documentation suggests.
Bellow is code demoing my
problems:
Even though I’m using
SetPopupPositionByInt(next_popup_position) with
next_popup_position cycling
among 0,1,2,3 - all the ToasterBoxs appear at
the same location.
Changing SetPopupPauseTime does
not produce any visible change.
Could anyone suggest what I’m
doing wrong ?
Nothing with the code itself, it’s
the approach: when you call multiple times ToasterBox, it just stacks more and
more ToasterBox windows on top of each other (like the MSN Messenger popups),
so the call to SetPopupPosition does nothing unless you call it before showing
the first ToasterBox.
Next, the call to SetPopupPauseTime
does nothing because you are not calling MainLoop() on the wx.App, which is
something you always need to do. Try the following modified script to see if
changing SetPopupPauseTime does something or not.
import wx
from wx.lib.agw import toasterbox as
TB
def generator():
i = 1
while True:
yield i
i = (i + 1) % 4
def
info_message_without_interaction(frame, msg, next_popup_position):
"""
"""
average_char_width = 8
x = 500
y = 50
tb = TB.ToasterBox(panel,
TB.TB_SIMPLE, TB.DEFAULT_TB_STYLE, TB.TB_ONTIME)
tb.SetPopupPauseTime(10000)
tb.SetPopupScrollSpeed(8)
tb.SetPopupText(msg)
tb.SetPopupSize((x,y))
tb.SetPopupPositionByInt(next_popup_position)
tb.SetPopupTextColor(wx.GREEN)
tb.SetPopupBackgroundColor(wx.BLUE)
tb.Play()
if name == ‘main’:
app = wx.App(redirect=False)
frame = wx.Frame(parent=None)
panel = wx.Panel(frame)
popup_position = generator()
for i in range(5):
next_popup_position =
popup_position.next()
msg =
str(next_popup_position)
info_message_without_interaction(frame, msg, next_popup_position)
wx.MilliSleep(200)
wx.SafeYield()
app.MainLoop()
Andrea.
···
On Mon, Feb 2, 2009 at 12:53 PM, Barak, Ron wrote:
Andrea
Gavana (gavana@kpo.kz)
Reservoir
Engineer
KPDL
Cardinal Place
80, Victoria Street
SW1E 5JL London
Direct Tel: +44 (0) 20
717 08936
Mobile Tel: +44 (0) 77
487 70534
Fax: +44 (0) 20 717
08900
Web: http://xoomer.alice.it/infinity77/index.html
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
This e-mail is intended only for the addressee named above. As this e-mail may contain confidential or privileged information, please advise us immediately if you are not the named addressee or the person responsible for delivering the message to the named addressee. The contents should not be disclosed to any other person nor copies taken. Unless expressly stated, any views, whether express or implied, are the sender’s personal views, do not necessarily reflect the views of KPO or any of its directors and are not approved by KPO Group and this email is not an offer, solicitation, recommendation or agreement of any kind.