Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

EG crashes

If you have a question or need help, this is the place to be.
Post Reply
easy
Posts: 46
Joined: Wed Dec 05, 2007 10:05 pm

EG crashes

Post by easy »

I put this into python script action. It is executed, I get the window, but then EG crashes.
import wx

class MyFrame(wx.Frame):
def __init__(self, parent, id, title):
wx.Frame.__init__(self, parent, id, title, wx.DefaultPosition, wx.Size(300, 200),wx.FRAME_NO_TASKBAR)
panel = wx.Panel(self, -1,(-1, -1),wx.Size(300, 200))
box = wx.BoxSizer(wx.VERTICAL)
font=wx.Font(21,wx.DEFAULT,wx.NORMAL,wx.BOLD,False)
text='Prima eilut─ù'
text2="Antra eilut─ù"
Ob=wx.StaticText(panel, -1, text)
Ob.SetFont(font)
Ob2=wx.StaticText(panel, -1, text2)
Ob2.SetFont(font)
Ob2.SetForegroundColour('#FFFFFF')
panel.SetBackgroundColour('#009999')
box.Add(Ob,0,wx.LEFT|wx.TOP,10)
box.Add(Ob2,0,wx.LEFT|wx.TOP,10)
panel.SetSizer(box)
panel.Bind(wx.EVT_KEY_DOWN, self.OnKeyDown)
panel.SetFocus()
self.Centre()

def OnKeyDown(self, event):
keycode = event.GetKeyCode()
if keycode == wx.WXK_ESCAPE:
self.Close()
event.Skip()

class MyApp(wx.App):
def OnInit(self):
frame = MyFrame(None, -1, 'Mano App')
frame.Show(True)
return True

app = MyApp(0)
app.MainLoop()
Hrrr.. spaces gets lost in the quote....
What did I wrong?
User avatar
Bitmonster
Site Admin
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Re: EG crashes

Post by Bitmonster »

1. This is not a bug, so I moved the topic out of the bug report forum.
2. Use

Code: Select all

 and not [QUOTE] tags.
3. Read my signature carefully! Your PM is completely software related and will be ignored.
4. You can't create another wx.App instance inside an already running wx.App instance. And you have to run wxPython related code inside the main thread (actions run in another thread). Study related plugins/actions like EventGhost.ShowOSD, System.ShowPicture and so on.
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!
easy
Posts: 46
Joined: Wed Dec 05, 2007 10:05 pm

Re: EG crashes

Post by easy »

Thank You - I'we finally managed to get on screen window working. At the moment plugin has only 2 actions - show and close, but I can work on it now...
It took me 3 hours to rewrite working test.py into plugin :)
Post Reply