I am trying to use toasterboxes and I ran into a problem. I added an ico
and static text with wrap, but it doesn't autosize.
What I mean by autosize is that depending on the text's length, I get a
certain amount of lines (since it wraps). I'd like the toasterbox's size
to adjust (at least it's height ). To add to the problem, the size
depends on the system's font. If I don't change the size, the extra text
gets cut off. Does anyone know how to do this?
Thank you,
Gabriel
Yes, a horizontal box sizer, here's the code :
def createToasterBox(message, logo, parent=None):
from wx.lib.agw import toasterbox
tb = toasterbox.ToasterBox(parent, toasterbox.TB_COMPLEX,
toasterbox.DEFAULT_TB_STYLE, toasterbox.TB_ONTIME)
#tb.SetPopupSize((200, 75))
xSize, ySize = wx.DisplaySize()
tb.SetPopupPosition((xSize-230, ySize-112))
tb.SetPopupPauseTime(7000)
tb.SetPopupScrollSpeed(2)
tbpanel = tb.GetToasterBoxWindow()
panel = wx.Panel(tbpanel, wx.ID_ANY)
sizer = wx.BoxSizer(wx.HORIZONTAL)
stbmp = wx.StaticBitmap(panel, wx.ID_ANY, logo)
sizer.Add(stbmp, border=10, flag=wx.EXPAND|wx.ALL)
message = wx.StaticText(panel, wx.ID_ANY, message)
message.Wrap(150)
sizer.Add(message, border=10, flag=wx.EXPAND|wx.TOP)
sizer.Layout()
panel.SetSizer(sizer)
tb.AddPanel(panel)
tb.Play()
I tried as you can see to also not set the size myself by commenting :
"tb.SetPopupSize((200, 75))", but that doesn't fix the problem.
Cheers,
Gabriel