wxpython strange behaviour

import wx
import wx.lib.agw.toasterbox as TB

from time import sleep

app = wx.App()

panel=wx.Panel(parent=wx.Frame(None))

toaster = TB.ToasterBox(parent=wx.Frame(None), tbstyle=TB.TB_COMPLEX, closingstyle=TB.TB_ONTIME)

toaster.SetPopupPauseTime(3000)

toaster.SetPopupPosition(wx.Point(1050,0))

toaster.SetPopupSize(wx.Size(320, 100))

toaster.SetPopupText(“Hello!!\nI am shdasdsadasfasfiva”)

wx.CallLater(300, toaster.Play)

``

I wrote this code to display a toasterbox, and I didnt want it to display any frames on the screen, just a toasterbox. The problem with this code is that it runs fine when I run it the first time, but when I run it next time it shows some error and the toasterbox doesnt disappear from the screen itself(it should though).
Error message I got:
https://gist.github.com/anonymous/f0d4ec685d2432c80a1

There is one more issue. I am using canopy as my environment, and when i run it using canopy it works fine at least for the first time but when I run it using command prompt in windows 10, nothing happens, I get no errors and still it does not work.

Please help me solve these issues.

Shiva Upreti wrote:

I wrote this code to display a toasterbox, and I didnt want it to
display any frames on the screen, just a toasterbox. The problem with
this code is that it runs fine when I run it the first time, but when
I run it next time it shows some error and the toasterbox doesnt
disappear from the screen itself(it should though).

There's a lot more you're not showing us. When I try this exact code
(adding an app.MainLoop() at the end so it works at all, and changing to
TB_SIMPLE so the text shows), it works just fine from the command line,
repeatedly.

Error message I got:
https://gist.github.com/anonymous/f0d4ec685d2432c80a1

That brings up a 404.

···

--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.

Sorry about the link. I just uploaded it again and here it is:
http://pasted.co/f398a1e4

I gave you the exact code I run and yes I dont add app.MainLoop() and it still works(I dont get the text though).
And by running it from cmd I meant first saving the file and then running it as ‘python <filename.py>’.

···

On Saturday, January 16, 2016 at 12:00:45 AM UTC+5:30, Tim Roberts wrote:

Shiva Upreti wrote:

I wrote this code to display a toasterbox, and I didnt want it to

display any frames on the screen, just a toasterbox. The problem with

this code is that it runs fine when I run it the first time, but when

I run it next time it shows some error and the toasterbox doesnt

disappear from the screen itself(it should though).

There’s a lot more you’re not showing us. When I try this exact code

(adding an app.MainLoop() at the end so it works at all, and changing to

TB_SIMPLE so the text shows), it works just fine from the command line,

repeatedly.

Error message I got:

https://gist.github.com/anonymous/f0d4ec685d2432c80a1

That brings up a 404.


Tim Roberts, ti...@probo.com

Providenza & Boekelheide, Inc.

You should finally decide on which list you want to ask for support on this issue.
Posting on multiple lists at the same does not increase your chances for a helpful answer.

Regards,

Dietmar

···

On 16.01.2016 01:40, Shiva Upreti wrote:

Sorry about the link. I just uploaded it again and here it is:
The easiest way to host your text

I am sorry, I didnt know about it. I will keep this in mind. Thank you.

···

On Saturday, January 16, 2016 at 6:25:24 AM UTC+5:30, Dietmar Schwertberger wrote:

On 16.01.2016 01:40, Shiva Upreti wrote:

Sorry about the link. I just uploaded it again and here it is:

http://pasted.co/f398a1e4

You should finally decide on which list you want to ask for support on
this issue.

Posting on multiple lists at the same does not increase your chances for
a helpful answer.

Regards,

Dietmar

That is impossible for me to believe. As written, your program will call wx.CallLater, and the process immediately exits, without every having drawn anything. wx.CallLater queues up a timer message, which is handled by MainLoop. As it is, no entity will ever process the CallLater, so the toaster box will not display. If you are running this from a UI of some sort, you may be inheriting their main loop, but it won’t work from a command line. I’ve tried it on both Windows and MacOS, and it doesn’t do anything without calling app.MainLoop.

The reason you don’t see the text is your use of TB_COMPLEX. When you use that, you are telling the control “I will provide all the controls in the box, you don’t have to”, which means the toaster ignores SetPopupText. If you want the control to draw the text, you have to use TB_SIMPLE.

And the code you provided looks NOTHING like the code in that paste.

···

On Jan 15, 2016, at 4:40 PM, Shiva Upreti katewinslet626@gmail.com wrote:

Sorry about the link. I just uploaded it again and here it is:
http://pasted.co/f398a1e4

I gave you the exact code I run and yes I dont add app.MainLoop() and it still works(I dont get the text though).


Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.