Re: [Pyobjc-dev] Cocoa Bindings and StringIO
Brought to you by:
ronaldoussoren
From: James R E. <ea...@cc...> - 2007-02-07 02:13:35
|
Oh, man, I hadn't even thought about the threading issue. The {will,did}changeValueForKey_ calls are definitely happening on a secondary thread, so that may potentially raise some hairyness farther down the road. But I think you're right... while log is a PyObjC object, the pure python object before it in the keyPath is probably blocking the notification from propogating up all the way. I think I'll just go ahead and stick with the polling solution... four times a second shouldn't be too bad. ;-) James PS: reminds me of the joke about the programmer who, when faced with a particular problem figures a regular expression will help. Now he has two problems. It seems like Cocoa Bindings are one such thing. If you can master them, they can be wonderful, but otherwise they're just a huge pita ;-) On Feb 6, 2007, at 20:57 , Dethe Elza wrote: > On 6-Feb-07, at 9:51 AM, James R Eagan wrote: > >> Basically, my text area content is bound to 'pyobject.log.buffer,' >> but the content never updates when the log updates. I've ended up >> getting a working solution to approach (2) -- polling using a >> repeating thread task, but I'm still somewhat confused about why >> solution (1) is not working as I expected. Is it because of the pure >> python object in the the keyPath? > > I'm not using Cocoa Bindings, but I do remember reading on this > list that they don't work with pure Python objects. Another > possible issue: you're using two threads, right? Are you posting > the notification on the main thread? > > --Dethe > > At some point in the past rolling out an application to 300,000 > people was the pinnacle of engineering excellence. Today it means > you passed your second round of funding and can move out of your > parents garage. --Joe Gregorio > > -- Against stupidity the very Gods themselves contend in vain. |