showing a list of mounted volumes with icon

2010-04-23 Thread Angelo Chen
Hi, Just like when press 'Option' while booting, we can see a list of volumes with icons, is there a simple way to do something similar in a sheet? Thanks, Angelo ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin reques

Re: showing a list of mounted volumes with icon

2010-04-23 Thread Angelo Chen
Hi Kyle, I'd just like show a collection of mounted volumes in a sheet and let user choose one of them. Thanks, Angelo --- 2010年4月24日 星期六,Kyle Sluder 寫道﹕ 寄件人: Kyle Sluder 主題: Re: showing a list of mounted volumes with icon 收件人: "Angelo Chen" 副本(CC): Cocoa-dev@lists.apple.com 日

Re: showing a list of mounted volumes with icon

2010-04-24 Thread Angelo Chen
of mounted volumes with icon 收件人: cocoa-dev@lists.apple.com 日期: 2010年4月24日,星期六,上午9:23 On 4/23/2010 5:47 PM, Angelo Chen wrote: > I'd just like show a collection of mounted volumes in a sheet and let user choose one of them. Carbon has a call just for this (NavCreateChooseVolumeDialog) but

getting file time stamp from a NTFS volume

2010-05-22 Thread Angelo Chen
Hi, I use following code to get file creation time stamp, it works with FAT32, but seems returning wrong date if the file is in a NTFS volume, any idea? Thanks, Angelo NSFileManager *fm= [NSFileManager defaultManager];NSDictionary *fileAttributes = [fm fileAttributesAtPath:path traverseLink:YES];

getting file creation date from NTFS

2010-05-22 Thread Angelo Chen
Hi, I'd like to get creation date of a file, here are the codes: NSDictionary *fileAttributes = [fileManager fileAttributesAtPath:path traverseLink:YES];NSLog(@"Dict %@", fileAttributes); This works if the file came from FAT or Mac OS X, but if it is in a NTFS volume, creation date is alw

Re: getting file creation date from NTFS

2010-05-22 Thread Angelo Chen
date from NTFS 收件人: "Ken Thomases" , "Angelo Chen" 副本(CC): cocoa-dev@lists.apple.com 日期: 2010年5月23日,星期日,上午1:14 > Also be aware that not all file systems support the notion of > creation dates of their objects.  I don'

Re: getting file creation date from NTFS

2010-05-23 Thread Angelo Chen
oid NSDateToUTCDateTime( NSDate* date, UTCDateTime *utc ){     *(unsigned long long*)utc = ([date timeIntervalSinceReferenceDate] - CarbonReferenceDate()) * 65536.0;} --- 2010年5月23日 星期日,Ken Thomases 寫道﹕ 寄件人: Ken Thomases 主題: Re: getting file creation date from NTFS 收件人: "Paul Sanders"

Re: getting file creation date from NTFS

2010-05-23 Thread Angelo Chen
ting file creation date from NTFS 收件人: "Angelo Chen" 副本(CC): cocoa-dev@lists.apple.com 日期: 2010年5月23日,星期日,下午7:12 On May 23, 2010, at 5:33 AM, Angelo Chen wrote: > I think FSGetCatalogInfo (&ref, kFSCatInfoCreateDate, &info, NULL, NULL, > NULL); info.createDate has the cre

terminates app when main window closes

2010-06-17 Thread Angelo Chen
Hi, I have a non document based application, I quit the app by sending terminate to NSApplication(file owner). if I close the main window, application will not be closed, what I'd like is, when user close the main window, application also terminates, possible? Thanks, Angelo _

Re: terminates app when main window closes

2010-06-18 Thread Angelo Chen
Thanks, applicationShouldTerminateAfterLastWindowClosed works. Now I'd like to prompt user if he really wants to quit, if not, return NO, that seems working as well. --- 2010年6月18日 星期五,Kyle Sluder 寫道﹕ 寄件人: Kyle Sluder 主題: Re: terminates app when main window closes 收件人: "Angelo Ch

RADPlugin framework

2010-06-20 Thread Angelo Chen
Hi,I have seen some Apple's applications having this RADPlugin, iMovie, FinalCut pro: /Applications/Final Cut Pro.app/Contents/PlugIns/AVCHD.RADPlug and sometimes, those files can be interchanged between iMovie and FinalCut Pro, is there documentation on this?  Thanks, Angelo _

AppleScript in a Cocoa app

2010-06-20 Thread Angelo Chen
Hi, I need to create an AppleScript and run it inside the app to activate another program, the applescript should call 'add' function the the other program with different file names, any idea how to achieve this? Thanks, Angelo ___ Cocoa-dev mailing

Re: detect NSPopUpButton changes

2010-06-22 Thread Angelo Chen
Hi, oic, i'm kind of ignorant:( however, since that even will be called every time when the drop down is selected, is there a way to check if selected item really change? thanks --- 2010年6月22日 星期二,Graham Cox 寫道﹕ 寄件人: Graham Cox 主題: Re: detect NSPopUpButton changes 收件人: "Angelo Ch

detect NSPopUpButton changes

2010-06-22 Thread Angelo Chen
Hi, How to detect if user has change NSPopupButton's selection? Thanks, Angelo   ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at

checking if an app installed

2010-06-23 Thread Angelo Chen
Hi, Is there a way to check if a certain application is installed? say if iMovie is installed? thanks, Angelo ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the mod

Re: checking if an app installed

2010-06-23 Thread Angelo Chen
ifier:@"com.apple.AppleIntermediateCodec"]; Thanks. --- 2010年6月24日 星期四,Stephen J. Butler 寫道﹕ 寄件人: Stephen J. Butler 主題: Re: checking if an app installed 收件人: "Angelo Chen" 副本(CC): Cocoa-dev@lists.apple.com 日期: 2010年6月24日,星期四,上午8:55 On Wed, Jun 23, 2010 at 7:48 PM, Angelo Chen wrote: > Hi,

set defaults in another application?

2010-07-01 Thread Angelo Chen
Hi, In application A, I use following code to set some settings: NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];NSData *defaultSettings = [defaults objectForKey : EXPORT_SETTINGS]; ExportSettings *es = [[ExportSettings alloc] init];NSData *settings = [es getExportSettings: defau

horizontal radio group

2010-07-01 Thread Angelo Chen
Hi, radio group created in Interface builder is vertical, how  to set it horizontal? example, two radio buttons in one line? Thanks, a.c. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments

NSTextField restriction

2010-02-10 Thread Angelo Chen
Hi, I have a NSTextField outlet, and I'd like to limit the input to: 1) only upper case alpha characters2) must be two characters Any idea how to achieve this? Thanks, Angelo ___ YM - 離線訊息 就算你沒有上網,你的朋友仍可以留下訊息給你,當你上網時就能立即看到,任何說話都冇走失。 http://messenger.yahoo.com

searching a string in big file

2009-06-12 Thread Angelo Chen
Hi, I need to open a big file and search for a certain string, if found, I need tup do some updates and write back the file, any idea what approach I should take? Thanks, Angelo Yahoo!香港提供網上安全攻略,教你如何防範黑客! 請前往 http://hk.promo.yahoo.com/security/ 了解更多! __

Re: searching a string in big file

2009-06-13 Thread Angelo Chen
tler 寫道﹕ 寄件人: Stephen J. Butler 主題: Re: searching a string in big file 收件人: 副本(CC): cocoa-dev@lists.apple.com 日期: 2009年6月13日,星期六,下午2:04 2009/6/13 Angelo Chen : > I need to open a big file and search for a certain string, if found, I need > tup do some updates and write back the file,

xcode 2.4 and gcc 3.3

2009-06-15 Thread Angelo Chen
Hi,every new project i created in xcode 2.4 uses gcc 3.3, but when compiling i got: gcc-3.3: installation problem, cannot exec `cc1obj': No such file or directory gcc-3.3: installation problem, cannot exec `cc1obj': No such file or directoryI need to change the gcc 3.3 to gcc 4.0, is there a way

renaming executable files

2009-06-21 Thread Angelo Chen
Hi, I need to rename the executable file without renaming the project, how to do that? thanks Yahoo!香港提供網上安全攻略,教你如何防範黑客! 請前往 http://hk.promo.yahoo.com/security/ 了解更多! ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post adm

Re: renaming executable files

2009-06-21 Thread Angelo Chen
thanks for the reply, i tried two approaches , all not working, still get the same name --- 2009年6月21日 星期日,Filip van der Meeren 寫道﹕ 寄件人: Filip van der Meeren 主題: Re: renaming executable files 收件人: "Angelo Chen" 副本(CC): cocoa-dev@lists.apple.com 日期: 2009年6月21日,星期日,下午9:51 Just chang

stepping in unit test

2009-06-22 Thread Angelo Chen
Hi, I'm using XCode 2.4.1, doing some unit test, is it possible to debug/step in unit test classes? Thanks, Angelo Yahoo!香港提供網上安全攻略,教你如何防範黑客! 請前往 http://hk.promo.yahoo.com/security/ 了解更多! ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) P

Intercepting console in an app

2009-07-08 Thread Angelo Chen
Hi, I use NSTask to run a command line program(ffmpeg in this case),  NSPipe can't get the output from the program, but I can see those messages from the Console during runtime, is there a way to grab the Console output from a running cocoa app? Thanks, Angelo Yahoo!香港提供網上安全攻略,教你如何防範黑客!

getting directories created from a certain time

2009-07-10 Thread Angelo Chen
Hi, I have a lengthy process where it creates a few directories, I'd like to know how to get a list of directories created since the starting of the process, any hints? Thanks, Angelo Yahoo!香港提供網上安全攻略,教你如何防範黑客! 請前往 http://hk.promo.yahoo.com/security/ 了解更多!

from CFDataRef to NSString

2008-06-10 Thread Angelo Chen
Hi, What is the correct way to cast from CFDataRef to NSString, I have this code: CFDataRef data; NSString *messageString = [NSString stringWithCString:CFDataGetBytePtr(data)]; it always return this warning, any idea? warning:pointer targets in passing argument 1 of 'stringWithCString:' differ

adding a delegate to a class

2008-06-10 Thread Angelo Chen
Hi, I have a code like this: @interface BackgroundObj : NSObject { Controller *mc; } - (void) sayHi; @implementation BackgroundObj - (void) sayHi { [mc showText:@"Hi"]; } @end As you can see, the code is hard coded to use class Controller, can not be used with any other obje

looking for a crc code

2008-06-13 Thread Angelo Chen
Hi, Is there a crc code that can be used directly in Objective-C? any tips? Thanks. Angelo Yahoo! Mail具備一流的網上安全保護功能,請前往 http://hk.antispam.yahoo.com/ 了解更多相關資訊! ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin req

using NSFileManager to read data

2008-06-14 Thread Angelo Chen
Hi, NSFileManager's contentsAtPath can read the entire file, is there a way to read only a specific bytes? something similar to NSFileHandle's readDataOfLength? thanks, Angelo Yahoo! Mail具備一流的網上安全保護功能,請前往 http://hk.antispam.yahoo.com/ 了解更多相關資訊! __

(no subject)

2008-06-16 Thread Angelo Chen
Hi, I have following action, two NSButtons are linked to it, I'd like to test which button trigger the action in the code, any way to do this? thanks. - (IBAction)doCopying:(id)sender { // how to determine which NSButton is clicked? } Angelo Yahoo! Mail具備一流的網上安全保護功能,請前往 http://hk.an

opening default email and browser from the code

2008-06-16 Thread Angelo Chen
Hi, I got two questions: 1) I have an email address in the code, I'd like to open default mailing program from the code with the email address as the recipient. 2) I have a NSImageView, when mouse move over it, the cursor should be changed to a hand, and when it is clicked, it will open a URL

iMovie HD like splash screen

2008-06-17 Thread Angelo Chen
Hi, I'd like to implement a iMovie HD like splash screen, here are some tips needed: 1) when the 'quit' button is clicked, how to quit the entire application? 2) the bottom of the splash is grey with rounded corners, how to do that? Thanks, Angelo Yahoo! Mail具備一流的網上安全保護功能,請前往 http://hk

Re: iMovie HD like splash screen

2008-06-17 Thread Angelo Chen
Hi, Thanks for the fast response, I tried the -setContentBorderTHickness, it does not work with me as I'm using Tiger 10.4.11, any equivalent of the method in this OS X? Angelo > Use NSWindow's new > -setContentBorderThickness:forEdge: method. > > Cheers, > -- Uli Kusterer > "The Witnesses

clickable NSImageView

2008-06-17 Thread Angelo Chen
Hi, I use the code at the end to let user click on an image and open a URL, this works, but not really satisfactory as when the mouse is moved over the image, the cursor was not changed to point-hand shape, any idea to improve this? Thanks, Angelo @interface BannerView : NSImageView { } -

getting accurate file modification time?

2008-06-17 Thread Angelo Chen
Hi, I use the code at end to get modification timestamp of a file including seconds, it works well until I encounter following: I have a file that is in the Document folder, the creation and modification date are both:2008-05-04 22:06:46 +0800 when this file is copied to a FAT volume, naturall

disable manual resizing of NSWindow

2008-06-18 Thread Angelo Chen
Hi, Is there a way to do following: In a NSWindow, I'd like to disable manual resizing(don't allow user to drag the lower right corner to resize the window), only by clicking 'max' and 'restore' icons, possible? the reason is, I put a QuickTIme's movieview in the window and the preserving aspe

getting free space available in a drive

2008-06-18 Thread Angelo Chen
Hi, how to get the total free space available in a drive? thanks, Angelo ___ YM - 離線訊息 就算你沒有上網,你的朋友仍可以留下訊息給你,當你上網時就能立即看到,任何說話都冇走失。 http://messenger.yahoo.com.hk ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.c

Error when building a Cocoa-Java app

2008-06-23 Thread Angelo Chen
Hi, I'm trying out Cocoa-Java application, in the XCode 2.4, I created a new object 'Cocoa-Java application', then click 'build', and it gives me error: command /Developer/Private/jam failed with exit code 1 any idea how to fix this? Thanks. Angelo ___ YM

Re: Error when building a Cocoa-Java app

2008-06-23 Thread Angelo Chen
not that support, only way is to go java. Angelo --- 2008年6月23日 星期一,Kyle Sluder <[EMAIL PROTECTED]> 寫道﹕ > 寄件人: Kyle Sluder <[EMAIL PROTECTED]> > 主題: Re: Error when building a Cocoa-Java app > 收件人: "Angelo Chen" <[EMAIL PROTECTED]> > 副本(CC): cocoa-dev@lists.

renaming a project

2008-08-23 Thread Angelo Chen
hi, I have a project which has "MyTest" as the project name, so the executable has the same name, now I'd like to rename it to "MyProg", I renamed the Xoce's project file to "MyProg", but the executable still has the previous name, any idea how to rename ? thanks Angelo 為了不斷提升Yahoo! M

specify a NSPredicate for jpeg file names?

2008-08-23 Thread Angelo Chen
Hi, I'd like to filter an array to return only jpeg file names like DSC0001.jpg, DSC0002.jpg, etc. could anybody help me modify the jpegPredicate for that mater? thanks NSPredicate *jpegPredicate = [NSPredicate predicateWithFormat:@"SELF [c] 'b'"]; NSArray *lst = [[[NSFileManager defaultManager

using OpenPanel to select volumes?

2008-08-23 Thread Angelo Chen
Hi, I use following code to select a volume, it works, but it also give the user chance to select directory as well, how to disable selection of directories, only allow volumes? thanks, NSOpenPanel *oPanel = [OpenPanel openPanel]; [oPanel setCanChooseFiles:NO]; [oPanel setCanChooseDirectories: