Re: Why the Cocoa function can't be called from JavaScript?

2009-09-14 Thread Rob Keniger
On 14/09/2009, at 1:41 PM, ziqian zhan wrote: When first time welcome.html is loaded into webView from -(void)awakeFromNib;, push the "change it" button on web page the -(NSString*)getName function is called. The "hello world" is replaced with "hi I'm here.". But when welcome.html loaded aga

Re: adding a page curl transition

2009-09-14 Thread Matt Neuburg
On Mon, 14 Sep 2009 09:32:11 -0700, Matt Neuburg said: >For example, I can imagine something like this. Take a "screen shot" of the >window. Cover the whole window with a secondary window. Behind the secondary >window, move the primary window on to the next entity. Take a second "screen >shot" of

Re: Help book content

2009-09-14 Thread Matt Neuburg
On or about 9/14/09 5:55 PM, thus spake "Kyle Sluder" : >> Always run your HTML thru a >> validator and if at all feasible use XHTML because it is even stricter and >> clearer. m. > > Don't do this. XHTML is not a strict subset of HTML. I didn't say it was. But it does work. :) All my help book

Re: Shutdown/Restart computer

2009-09-14 Thread vinai
A call to the system command, like: system ("sudo /sbin/shutdown -h now'); You'd have to make sure your user is authenticated to use shutdown via sudo ... I'm not sure if there's a cleaner way specific to OS X. The above should work a reasonable portion of UNIX and UNIX-type systems. vina

Re: adding a page curl transition

2009-09-14 Thread Matt Neuburg
On or about 9/14/09 5:53 PM, thus spake "Graham Cox" : > I'm not sure your interface will really make much sense to an end-user > (since it's uncommon and therefore unexpected behaviour) Well, it wasn't uncommon back on System 6 and 7 using HyperCard. :) m. -- matt neuburg, phd = m...@tidbits.c

Re: Help book content

2009-09-14 Thread Kyle Sluder
On Sep 14, 2009, at 6:14 PM, Matt Neuburg wrote: I didn't say it was. But it does work. :) All my help books are XHTML. m. Well if you're going to write XHTML, that makes sense. But using an XHTML validator on HTML is worse than not validating at all, because it can give you incorrect re

Re: Shutdown/Restart computer

2009-09-14 Thread Kyle Sluder
On Sep 14, 2009, at 6:14 PM, vinai wrote: A call to the system command, like: system ("sudo /sbin/shutdown -h now'); Nononono. This is entirely the wrong way to do this. ESPECIALLY for privileged operations. Read the section Application Responsibilities in Logout Responsibilities in

Need -[NSTask waitUntilExitOrTimeout:] (was NSTask "Thread Unsafe"...)

2009-09-14 Thread Jerry Krinock
The reason why I asked this is because I need: -[NSTask waitUntilExitOrTimeout:(NSTimeInterval)]. But there is no such method. So, I wrote a wrapper around NSTask that does this. On 2009 Sep 14, at 07:41, Adam R. Maxwell wrote: Ordinarily, I'd guess that it's supposed to mean that you c

Re: Shutdown/Restart computer

2009-09-14 Thread Nick Zitzmann
On Sep 14, 2009, at 6:59 PM, PCWiz wrote: How would I shut down and restart the computer using Objective-C code? Don't use the /sbin/shutdown command as previously recommended. That command will not give users the chance to save their work before the reboot/shutdown. Instead, send events

Re: adding a page curl transition

2009-09-14 Thread Dave Keck
> (4) Now I perform the animated transition in the layer, using the second > screen shot as the target image. Is that necessary? Couldn't image1 be the current state of the window, and image2 just be a transparent image? If I'm picturing this correctly, image1 would curl away, to reveal the actual

Re: testing ppc on intel

2009-09-14 Thread Chris Idou
10.5.8. Now that I try, a new empty Cocoa app in XCode works. My app is just a one window Cocoa program that links with two frameworks (both of which are universal with ppc). arch -ppc works with /bin/cat, iTunes and so forth. Just not with my programs. I'm pretty sure I have no input managers,

How to implement to rename the file by single click its name column

2009-09-14 Thread James
Hi all, I have implemented to play the music file by double click its name in a table view using the setDoubleAction: method. Now, I am in trouble. I want to realize the result that similar to the "name" column in iTunes. Namely,it will play the music file if user double-clicks on th

Re: Need -[NSTask waitUntilExitOrTimeout:] (was NSTask "Thread Unsafe"...)

2009-09-14 Thread Jens Alfke
On Sep 14, 2009, at 6:29 PM, Jerry Krinock wrote: Uh, yeah, it took me a while to track that one down. Apparently, running a run loop that is already running is not a good idea. That's not generally true; there's definitely code that does this. I've found that generally it helps to run th

Re: How to implement to rename the file by single click its name column

2009-09-14 Thread Jens Alfke
On Sep 14, 2009, at 8:12 PM, James wrote: I can implement to play the file by double click its name column only. But I do not know how to implement to rename the file by single click its name column. Unfortunately this isn't one of the things NSTableView makes easy for you. If I recal

NSOperation and lazy loading

2009-09-14 Thread Christopher Drum
A recurring theme in Cocoa development is that of "being lazy" and of "lazy loading" and the like. Given this Cocoa development pattern, I am having a difficult time understanding the architecture of the following scenario. 1. We have a "Person" object which will fetch an image of said Pers

Re: NSOperation and lazy loading

2009-09-14 Thread Kyle Sluder
Make your Person class KVO-compliant for the image property. If the object has not yet downloaded and cached it's image, have its -image method return a generic placeholder image (or nil) and start a background fetch. When the download is complete, have it call - setImage: on the Person for

Re: NSOperation and lazy loading

2009-09-14 Thread Graham Cox
On 15/09/2009, at 2:18 PM, Christopher Drum wrote: So what is the recommended architecture for the original requester to remain interested in receiving the image when it finally finishes loading? I believe I need the requesting object to register for a notification of some sort, which mean

Re: NSOperation and lazy loading

2009-09-14 Thread Roland King
Christopher Drum wrote: A recurring theme in Cocoa development is that of "being lazy" and of "lazy loading" and the like. Given this Cocoa development pattern, I am having a difficult time understanding the architecture of the following scenario. 1. We have a "Person" object which will

Re: sprintf and 64-bit integers

2009-09-14 Thread Andrew Farmer
On 14 Sep 2009, at 11:48, Sean McBride wrote: On 9/13/09 12:01 PM, Jens Alfke said: It would be best to convert all your sprintf calls to snprintf, which is a safer equivalent that won't overflow the buffer. Yes, sprintf is pure evil. snprintf is less evil. Also, I recommend adding -fstack-p

Re: NSPopUpButton breaks in Snow Leopard

2009-09-14 Thread ALEXander
Hi, actually, I used the binding to the "Content" fields of NSPopUpButton because the possible selection that has to be displayed in the PopUp changes dynamically. Otherwise I could just have set the menu in IB. I put a breakpoint on controlTypes and it does return an NSArray filled with

Interface Builder .xib deployment/development targets

2009-09-14 Thread Steve Cronin
Folks; I have an app with a 10.4 Deployment target. I have recently begun using XC 3.2 and IB 3.2 - spp compiles cleanly and all IB 'sibling' issues have been resolved. I've gotten a field report (release) where I'm seeing: 15:01:38.292 XYZ[11756:20b] HIToolbox: ignoring exception '*** -[NS

Re: Interface Builder .xib deployment/development targets

2009-09-14 Thread Graham Cox
On 15/09/2009, at 4:44 PM, Steve Cronin wrote: 15:01:38.292 XYZ[11756:20b] HIToolbox: ignoring exception '*** -[NSCFString substringToIndex:]: Range or index out of bounds' that raised inside Carbon event dispatch This is occurring just as nib is about to open a first window. I've not seen

Re: Interface Builder .xib deployment/development targets

2009-09-14 Thread Graham Cox
On 15/09/2009, at 4:44 PM, Steve Cronin wrote: Reporting machine is MacBookPro5,1 - 10.5.8 Whoops, just realised you already answered my question. Maybe the logging got added in 10.5.(late)... ??? --Graham ___ Cocoa-dev mailing list (Cocoa

<    1   2