[Pythonmac-SIG] Problem with open_app Action Event

Stefan Holmer stefan at feelthemachine.com
Fri Jul 14 20:43:53 CEST 2006


I'm writing the application in Python using the MiniAEFrame module which 
comes with MacPython. I've built it mostly like the example test class 
in MiniAEFrame named _Test. Although, I noticed that I had to change the 
code "aevt" to "tvea" and "oapp" to "codo", don't know why though? Have 
these codes been changed?

I've bound the method "open_app" to the "tvea"/"codo" event and it's 
being called when I do "open with..." on a file while the program is 
running. But when the program isn't running, it starts, though the 
"open_app" method isn't called. I also have a method "other" bound to 
"****"/"****" which just reports that an unhandled event has been 
caught, and it's not reporting anything either.

Does this information help, or do you need to know something else? My 
code looks like this:

import MacOS, EasyDialogs
from MiniAEFrame import AEServer, MiniApplication
import Carbon

class MyApp(AEServer, MiniApplication):
    def __init__(self):
        MiniApplication.__init__(self)
        AEServer.__init__(self)
        self.installaehandler('tvea', 'codo', self.open_app)
        self.installaehandler('****', '****', self.other)
        self.mainloop()
 
    def open_app(self, _object, _class, _type, **args):
        EasyDialogs.Message("open_app")

    def other(self, _object=None, _class=None, _type=None, **args):
        EasyDialogs.Message("other: " + _class + " " + _type)

MyApp()


Bob Ippolito skrev:
>
> On Jul 14, 2006, at 1:51 AM, Stefan Holmer wrote:
>
>> I'm trying to open pictures with my program using right click and "Open
>> with...". It works when the program is already started, but when the
>> program gets started with the "Open with..." I don't receive an Action
>> Event at all it seems.
>>
>> Why is this? And how do I fix it?
>
> First you have to give enough information so that we have *some* idea 
> what you're talking about. Most importantly, is this a PyObjC app, 
> wxWindows, etc. and how was the application built?
>
> -bob
>
>


More information about the Pythonmac-SIG mailing list