hello to all,

I want use this method for reopen my app if the user close it (it isn't a document based application), the event works, when my app is closed and i click on the dock, i can run the code inside this function:

def applicationShouldHandleReopen_hasVisibleWindows_(self, controller, flag):
print controller
print flag
print "Try"
return True


Ok, but in which way I tell to the cocoa to redisplay my windows? The only main is:
AppHelper.runEventLoop(argv=[])
But i cannot relaunch it obviously, so what is the function, event, something, that can tell to reload the nib interface?


Thanks folks

Here the sample code i use:

import objc
from Foundation import *
from AppKit import *
from PyObjCTools import NibClassBuilder, AppHelper


NibClassBuilder.extractClasses("MainMenu")


# class defined in MainMenu.nib class notes(NibClassBuilder.AutoBaseClass): # the actual base class is NSObject # The following outlets are added to the class: # button # label

    def applicationDidFinishLaunching_(self, aNotification):
        NSLog( "asdasd." )

    def change_(self, sender):
        print "Change Action"

#def applicationShouldTerminateAfterLastWindowClosed_(self, controller):
# return True


def applicationShouldHandleReopen_hasVisibleWindows_(self, controller, flag):
print controller
print flag
print "caccamo"
return True


AppHelper.runEventLoop(argv=[])

Whamoo www.rknet.it
Powered by:
- MacOsX
- Gnu / Linux Debian Sarge
- Amiga Os 3.9
- Milk

_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig

Reply via email to