Re: [Gtk-osx-devs] [python] Multiple python instances of gtk_osxapplication



On Aug 3, 2010, at 3:19 AM, Richard Procter wrote:

> 
> On 30/07/2010, at 2:59 AM, John Ralls wrote:
> 
>> 
>> On Jul 28, 2010, at 9:09 PM, Richard Procter wrote:
>> 
>>> Hi there,
>>> 
>>> I'm using the python bindings to gtk_osxapplication.
>>> 
>>> A couple of days ago I tried instantiating two
>>> gtk_osxapplication.OSXApplication()s, which the source seems to
>>> suggest is ok (at least under C) as the underlying object is a
>>> singleton. This was to avoid coupling the highest level of my program
>>> with one of the lowest, which needs access to the bundle paths.
>>> 
>>> Unfortunately it didn't work (I'm afraid I don't remember the
>>> details; if anyone is interested I can try to reproduce it).
>>> [snip]
>> 
>> Might you have created the two instances in separate threads? I didn't write it to be thread safe (which was perhaps naughty of me, but multi-threading event loop operations is risky and best avoided).
> 
> Hi John,
> 
> Good point but I'm not using any threads within python. I tried to break it in a simple test case (create two instances and call some basic functions on them) without luck. Reproducing the original problem remains on my todo list, I'm aiming to get back to it later in the week.
> 
> I factored out the bundle methods into module functions over the weekend; patch attached. I think it's an improvement and would like to see it committed at some point, my only reservation is that this is an interface change and there's everyone else using it to consider. That said, the necessary user changes are trivial - if one has the OSXApplication object, one can import the module and call the appropriate function directly.


That's two interface changes in the next release (the other is getting rid of app menu groups in favor of just inserting separators). I'll reduce the shock by keeping the old interfaces around for a while, marked as deprecated and re-written to call the new ones. 

Regards,
John Ralls





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]