LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 02-06-2008, 03:03 AM   #1
mp035
LQ Newbie
 
Registered: May 2006
Posts: 7

Rep: Reputation: 1
wxPython Catch System Shutdown


Hi All,
I have an application that needs to clean up on user logout, and system shutdown, i use the following code:

Code:
class MyApp(wx.App):
    def OnInit(self):
        wx.InitAllImageHandlers()
        self.frame_1 = MyFrame(None, -1, "")
        self.SetTopWindow(self.frame_1)

        self.Bind(wx.EVT_QUERY_END_SESSION, self.evt_system_shutdown)
        self.Bind(wx.EVT_END_SESSION, self.evt_system_shutdown)
        return 1

    def evt_system_shutdown(self, event):
        wx.MessageBox("TRIGGERED!")
        self.frame_1.Close(True)
But the messagebox is never displayed, nor my frames close method. Can anyone tell me what I'm missing?
 
Old 02-07-2008, 03:28 PM   #2
JudyL
LQ Newbie
 
Registered: Aug 2007
Location: Florida, USA
Distribution: Ubuntu
Posts: 29

Rep: Reputation: 15
You might want to ask on the wxWidgets forum http://wxforum.shadonet.com
 
Old 02-10-2008, 05:04 PM   #3
mp035
LQ Newbie
 
Registered: May 2006
Posts: 7

Original Poster
Rep: Reputation: 1
Thanks

Done, Thanks.
 
  


Reply

Tags
wxpython, wxwidgets


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
System shutdown on its own.........? M$ISBS Linux - Security 3 05-14-2006 10:56 PM
Why can't my system shutdown? naihe2010 Linux - Software 1 11-27-2005 05:50 PM
reason for system shutdown manjushp Linux - Security 1 06-03-2005 02:06 PM
WxPython install help 64 bit system MarkLinux222 Linux - Software 0 02-08-2005 03:59 PM
System Halting while shutdown system. LiloAma Linux - Software 15 01-02-2005 09:30 PM


All times are GMT -5. The time now is 09:17 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration