From heizer1 at llnl.gov Wed May 2 18:33:05 2007 From: heizer1 at llnl.gov (Charles Heizer) Date: Wed May 2 18:33:18 2007 Subject: Best way to reboot a system... Message-ID: Hello, I'm writing a small Cocoa app which has a button to reboot the system. What is the best way to do this? I looked at the reboot C function but it requires super-user. I would like to do it cleanly like the finder. Thanks, - Charles ------------------------------------------------------------------------ Charles Heizer Systems Management Solutions Group Lawrence Livermore National Laboratory 7000 East Ave. L-285 Livermore, CA 94550 Phone: (925)422-0197 Fax:(925)422-2425 email: heizer1@llnl.gov ------------------------------------------------------------------------ From peciva at pharos.co.nz Wed May 2 18:43:27 2007 From: peciva at pharos.co.nz (Tobias Peciva) Date: Wed May 2 18:43:41 2007 Subject: Best way to reboot a system... In-Reply-To: References: Message-ID: <302D1952-B28A-4BE1-A30F-341CA1050003@pharos.co.nz> http://developer.apple.com/qa/qa2001/qa1134.html Peace, Tobias Peciva On 3/05/2007, at 1:33 PM, Charles Heizer wrote: > Hello, > I'm writing a small Cocoa app which has a button to reboot the > system. What is the best way to do this? I looked at the reboot C > function but it requires super-user. I would like to do it cleanly > like the finder. > > Thanks, > - Charles From heizer1 at llnl.gov Wed May 2 20:51:19 2007 From: heizer1 at llnl.gov (Charles Heizer) Date: Wed May 2 20:51:24 2007 Subject: applicationDidFinishLaunching problems Message-ID: <4C34733D-6466-4DE4-BA00-E5101F3D82B4@llnl.gov> Hello, I'm having a problem with using "applicationDidFinishLaunching", BTW I'm still really new to COCOA. I have added this to my "MyController.m" file and it never seems to get called. I have looked at the docs but I'm unclear as too what I'm doing wrong. - (void)applicationDidFinishLaunching:(NSNotification*)notification { NSLog(@"Hello World"); } Any help would be great, Thanks, - Charles ------------------------------------------------------------------------ Charles Heizer Systems Management Solutions Group Lawrence Livermore National Laboratory 7000 East Ave. L-285 Livermore, CA 94550 Phone: (925)422-0197 Fax:(925)422-2425 email: heizer1@llnl.gov ------------------------------------------------------------------------ From macosxdevlist at personal.fishh2o.com Wed May 2 20:55:46 2007 From: macosxdevlist at personal.fishh2o.com (SD) Date: Wed May 2 20:56:22 2007 Subject: applicationDidFinishLaunching problems In-Reply-To: <4C34733D-6466-4DE4-BA00-E5101F3D82B4@llnl.gov> References: <4C34733D-6466-4DE4-BA00-E5101F3D82B4@llnl.gov> Message-ID: You need to set the object/class as the delegate for the Application. Usually you do this in the main nib file. ______________________________________________________________________ Previous message on 5/2/07 at 8:51 PM -0700 ********************************************************************** >Hello, >I'm having a problem with using "applicationDidFinishLaunching", BTW >I'm still really new to COCOA. I have added this to my >"MyController.m" file and it never seems to get called. I have >looked at the docs but I'm unclear as too what I'm doing wrong. > >- (void)applicationDidFinishLaunching:(NSNotification*)notification { > > NSLog(@"Hello World"); > >} > >Any help would be great, > >Thanks, >- Charles > >------------------------------------------------------------------------ >Charles Heizer >Systems Management Solutions Group >Lawrence Livermore National Laboratory >7000 East Ave. >L-285 >Livermore, CA 94550 >Phone: (925)422-0197 >Fax:(925)422-2425 >email: heizer1@llnl.gov >------------------------------------------------------------------------ > > >_______________________________________________ >MacOSX-dev mailing list >MacOSX-dev@omnigroup.com >http://www.omnigroup.com/mailman/listinfo/macosx-dev -- ========================================== SD WARNING: Programming may be habit forming. From heizer1 at llnl.gov Wed May 2 21:08:13 2007 From: heizer1 at llnl.gov (Charles Heizer) Date: Wed May 2 21:08:17 2007 Subject: applicationDidFinishLaunching problems In-Reply-To: References: <4C34733D-6466-4DE4-BA00-E5101F3D82B4@llnl.gov> Message-ID: <3FE16AAE-B837-499C-8BB5-B567948E6A8E@llnl.gov> Thanks, that did it! - Charles On May 2, 2007, at 8:55 PM, SD wrote: > You need to set the object/class as the delegate for the > Application. Usually you do this in the main nib file. > > ______________________________________________________________________ > Previous message on 5/2/07 at 8:51 PM -0700 > ********************************************************************** >> Hello, >> I'm having a problem with using "applicationDidFinishLaunching", >> BTW I'm still really new to COCOA. I have added this to my >> "MyController.m" file and it never seems to get called. I have >> looked at the docs but I'm unclear as too what I'm doing wrong. >> >> - (void)applicationDidFinishLaunching:(NSNotification*)notification { >> >> NSLog(@"Hello World"); >> >> } >> >> Any help would be great, >> >> Thanks, >> - Charles >> >> --------------------------------------------------------------------- >> --- >> Charles Heizer >> Systems Management Solutions Group >> Lawrence Livermore National Laboratory >> 7000 East Ave. >> L-285 >> Livermore, CA 94550 >> Phone: (925)422-0197 >> Fax:(925)422-2425 >> email: heizer1@llnl.gov >> --------------------------------------------------------------------- >> --- >> >> >> _______________________________________________ >> MacOSX-dev mailing list >> MacOSX-dev@omnigroup.com >> http://www.omnigroup.com/mailman/listinfo/macosx-dev > > > -- > ========================================== > SD > > WARNING: Programming may be habit forming. > ------------------------------------------------------------------------ Charles Heizer Systems Management Solutions Group Lawrence Livermore National Laboratory 7000 East Ave. L-285 Livermore, CA 94550 Phone: (925)422-0197 Fax:(925)422-2425 email: heizer1@llnl.gov ------------------------------------------------------------------------ From heizer1 at llnl.gov Thu May 3 11:16:59 2007 From: heizer1 at llnl.gov (Charles Heizer) Date: Thu May 3 11:17:22 2007 Subject: NSPopupButton Question Message-ID: <65644A65-6FDB-4812-BAC3-3D5530AB9D86@llnl.gov> Hello, Since I'm new please forgive me for the simple question :-). How do I quickly get the index number and the title value of the selected NSPopupButton ... So here is what I've got and it works to populate the popup ... [thePopUp removeAllItems]; [ thePopUp addItemsWithTitles:[NSArray arrayWithObjects:@"5 Minutes", @"10 Minutes", @"15 Minutes", @"30 Minutes", @"1 hour", @"2 hours", @"Never", @"1 Minute", nil]]; I hope this make sense, Thanks, - Charles ------------------------------------------------------------------------ Charles Heizer Systems Management Solutions Group Lawrence Livermore National Laboratory 7000 East Ave. L-285 Livermore, CA 94550 Phone: (925)422-0197 Fax:(925)422-2425 email: heizer1@llnl.gov ------------------------------------------------------------------------ From heizer1 at llnl.gov Thu May 3 11:24:09 2007 From: heizer1 at llnl.gov (Charles Heizer) Date: Thu May 3 11:24:15 2007 Subject: NSPopupButton Question In-Reply-To: <65644A65-6FDB-4812-BAC3-3D5530AB9D86@llnl.gov> References: <65644A65-6FDB-4812-BAC3-3D5530AB9D86@llnl.gov> Message-ID: <7A37C9E0-A74E-4133-8288-497F5030BB43@llnl.gov> Never mind, I just figured it out ... :-P [thePopUp titleOfSelectedItem]; [thePopUp indexOfSelectedItem]; On May 3, 2007, at 11:16 AM, Charles Heizer wrote: > Hello, > Since I'm new please forgive me for the simple question :-). > > How do I quickly get the index number and the title value of the > selected NSPopupButton ... > > So here is what I've got and it works to populate the popup ... > > [thePopUp removeAllItems]; > [ thePopUp addItemsWithTitles:[NSArray arrayWithObjects:@"5 > Minutes", @"10 Minutes", @"15 Minutes", @"30 Minutes", @"1 hour", > @"2 hours", @"Never", @"1 Minute", nil]]; > > > I hope this make sense, > Thanks, > - Charles > > > ---------------------------------------------------------------------- > -- > Charles Heizer > Systems Management Solutions Group > Lawrence Livermore National Laboratory > 7000 East Ave. > L-285 > Livermore, CA 94550 > Phone: (925)422-0197 > Fax:(925)422-2425 > email: heizer1@llnl.gov > ---------------------------------------------------------------------- > -- > > > _______________________________________________ > MacOSX-dev mailing list > MacOSX-dev@omnigroup.com > http://www.omnigroup.com/mailman/listinfo/macosx-dev > ------------------------------------------------------------------------ Charles Heizer Systems Management Solutions Group Lawrence Livermore National Laboratory 7000 East Ave. L-285 Livermore, CA 94550 Phone: (925)422-0197 Fax:(925)422-2425 email: heizer1@llnl.gov ------------------------------------------------------------------------ From janos.lobb at yale.edu Thu May 3 11:50:38 2007 From: janos.lobb at yale.edu (=?ISO-8859-1?Q?J=E1nos?=) Date: Thu May 3 11:50:43 2007 Subject: libjpeg Message-ID: Hi, I am trying to create a shared library from the libjpeg source - www.ijg.org. So in the source directory I do the following: bml0042:/Volumes/Data/Downloads/source/jpeg-6b janos$ ./configure -- enable-shared checking for gcc... gcc checking whether the C compiler (gcc ) works... yes checking whether the C compiler (gcc ) is a cross-compiler... no checking whether we are using GNU C... yes checking how to run the C preprocessor... gcc -E checking for function prototypes... yes checking for stddef.h... yes checking for stdlib.h... yes checking for string.h... yes checking for size_t... yes checking for type unsigned char... yes checking for type unsigned short... yes checking for type void... yes checking for working const... yes checking for inline... __inline__ checking for broken incomplete types... ok checking for short external names... ok checking to see if char is signed... yes checking to see if right shift is signed... yes checking to see if fopen accepts b spec... yes checking for a BSD compatible install... /usr/bin/install -c checking for ranlib... ranlib checking host system type... ltconfig: cannot guess host type; you must specify one Try `ltconfig --help' for more information. checking libjpeg version number... 62 creating ./config.status creating Makefile creating jconfig.h bml0042:/Volumes/Data/Downloads/source/jpeg-6b janos$ make ./libtool --mode=compile gcc -O2 -I. -c ./jcapimin.c make: ./libtool: Command not found make: *** [jcapimin.lo] Error 127 There is no libtool in the current directory, so I try to run ltconfig as: bml0042:/Volumes/Data/Downloads/source/jpeg-6b janos$ ltconfig -- srcdir=./ --with-gcc ltmain.sh checking host system type... ltconfig: cannot guess host type; you must specify one Try `ltconfig --help' for more information. Looking into the config.guess file I see that neither "Power Macintosh" nor "Darwin" is there. If I copy over libtool from /usr/bin and try make, - probably not a good idea - then I get this error: bml0042:/Volumes/Data/Downloads/source/jpeg-6b janos$ make ./libtool --mode=compile gcc -O2 -I. -c ./jcapimin.c ./libtool: unknown option character `-' in: --mode=compile Usage: ./libtool -static [-] file [...] [-filelist listfile [,dirname]] [-arch_only arch] [-sacLT] Usage: ./libtool -dynamic [-] file [...] [-filelist listfile [,dirname]] [-arch_only arch] [-o output] [-install_name name] [- compatibility_version #] [-current_version #] [-seg1addr 0x#] [- segs_read_only_addr 0x#] [-segs_read_write_addr 0x#] [-seg_addr_table ] [-seg_addr_table_filename ] [-all_load] [-noall_load] make: *** [jcapimin.lo] Error 1 What does it mean: "unknown option character `-' in: -- mode=compile" ? Does it complain about -O2, or -l or -c ? I am looking it but not seeing it :) Thanks ahead, J?nos From leeg at thaesofereode.info Thu May 3 11:58:22 2007 From: leeg at thaesofereode.info (Graham J Lee) Date: Thu May 3 11:58:35 2007 Subject: libjpeg In-Reply-To: References: Message-ID: <150F2E2F-C6F9-4A33-B3D7-118F47965AFD@thaesofereode.info> On 3 May 2007, at 19:50, J?nos wrote: > If I copy over libtool from /usr/bin and try make, - probably not a > good idea - then I get this error: > > bml0042:/Volumes/Data/Downloads/source/jpeg-6b janos$ make > ./libtool --mode=compile gcc -O2 -I. -c ./jcapimin.c > ./libtool: unknown option character `-' in: --mode=compile > Usage: ./libtool -static [-] file [...] [-filelist listfile > [,dirname]] [-arch_only arch] [-sacLT] > Usage: ./libtool -dynamic [-] file [...] [-filelist listfile > [,dirname]] [-arch_only arch] [-o output] [-install_name name] [- > compatibility_version #] [-current_version #] [-seg1addr 0x#] [- > segs_read_only_addr 0x#] [-segs_read_write_addr 0x#] [- > seg_addr_table ] [-seg_addr_table_filename > ] [-all_load] [-noall_load] > make: *** [jcapimin.lo] Error 1 > > > What does it mean: "unknown option character `-' in: -- > mode=compile" ? Does it complain about -O2, or -l or -c ? I think it's complaining about --mode=compile, which it's trying to parse as the options: - m o d e ... as the system libtool probably doesn't grok GNU long options. Don't know what the solution is though; you could see how fink's libjpeg- shlibs package gets built :-) Graham. From koryn.grant at gmail.com Thu May 3 12:47:03 2007 From: koryn.grant at gmail.com (Koryn Grant) Date: Thu May 3 12:47:16 2007 Subject: libjpeg In-Reply-To: References: Message-ID: <27A5F34B-A5F6-4B5B-A4C5-C518EEC337E3@gmail.com> The following procedure worked for me: 1. Install GNU libtool in /usr/local/bin (the default). 2. ./configure --enable-shared 3. ln -s /usr/local/bin/libtool ./libtool 4. make 5. sudo make install Cheers, Koryn On 4/05/2007, at 6:50 AM, J?nos wrote: > Hi, > > I am trying to create a shared library from the libjpeg source - > www.ijg.org. So in the source directory I do the following: > > bml0042:/Volumes/Data/Downloads/source/jpeg-6b janos$ ./configure -- > enable-shared > checking for gcc... gcc > checking whether the C compiler (gcc ) works... yes > checking whether the C compiler (gcc ) is a cross-compiler... no > checking whether we are using GNU C... yes > checking how to run the C preprocessor... gcc -E > checking for function prototypes... yes > checking for stddef.h... yes > checking for stdlib.h... yes > checking for string.h... yes > checking for size_t... yes > checking for type unsigned char... yes > checking for type unsigned short... yes > checking for type void... yes > checking for working const... yes > checking for inline... __inline__ > checking for broken incomplete types... ok > checking for short external names... ok > checking to see if char is signed... yes > checking to see if right shift is signed... yes > checking to see if fopen accepts b spec... yes > checking for a BSD compatible install... /usr/bin/install -c > checking for ranlib... ranlib > checking host system type... ltconfig: cannot guess host type; you > must specify one > Try `ltconfig --help' for more information. > checking libjpeg version number... 62 > creating ./config.status > creating Makefile > creating jconfig.h > > bml0042:/Volumes/Data/Downloads/source/jpeg-6b janos$ make > ./libtool --mode=compile gcc -O2 -I. -c ./jcapimin.c > make: ./libtool: Command not found > make: *** [jcapimin.lo] Error 127 > > There is no libtool in the current directory, so I try to run > ltconfig as: > > bml0042:/Volumes/Data/Downloads/source/jpeg-6b janos$ ltconfig -- > srcdir=./ --with-gcc ltmain.sh > checking host system type... ltconfig: cannot guess host type; you > must specify one > Try `ltconfig --help' for more information. > > Looking into the config.guess file I see that neither "Power > Macintosh" nor "Darwin" is there. > > If I copy over libtool from /usr/bin and try make, - probably not a > good idea - then I get this error: > > bml0042:/Volumes/Data/Downloads/source/jpeg-6b janos$ make > ./libtool --mode=compile gcc -O2 -I. -c ./jcapimin.c > ./libtool: unknown option character `-' in: --mode=compile > Usage: ./libtool -static [-] file [...] [-filelist listfile > [,dirname]] [-arch_only arch] [-sacLT] > Usage: ./libtool -dynamic [-] file [...] [-filelist listfile > [,dirname]] [-arch_only arch] [-o output] [-install_name name] [- > compatibility_version #] [-current_version #] [-seg1addr 0x#] [- > segs_read_only_addr 0x#] [-segs_read_write_addr 0x#] [- > seg_addr_table ] [-seg_addr_table_filename > ] [-all_load] [-noall_load] > make: *** [jcapimin.lo] Error 1 > > > What does it mean: "unknown option character `-' in: -- > mode=compile" ? Does it complain about -O2, or -l or -c ? > > I am looking it but not seeing it :) > > Thanks ahead, > > J?nos_______________________________________________ > MacOSX-dev mailing list > MacOSX-dev@omnigroup.com > http://www.omnigroup.com/mailman/listinfo/macosx-dev From dunham at mac.com Thu May 3 15:08:16 2007 From: dunham at mac.com (David Dunham) Date: Thu May 3 15:08:24 2007 Subject: libjpeg In-Reply-To: References: Message-ID: On 3 May 2007, at 11:50, J?nos wrote: > I am trying to create a shared library from the libjpeg source - > www.ijg.org. So in the source directory I do the following: FWIW, I've always made a CodeWarrior or Xcode project from libjpeg, which I think made it much easier to do a universal build. I realize this doesn't directly help you, but it's not difficult. David Dunham Macintosh Game Developer GameHouse Studios +1 206 926 5722 http://www.gamehouse.com "They said it couldn't be done but sometimes it doesn't work out that way." -- Casey Stengel From stephane at sente.ch Fri May 4 00:03:18 2007 From: stephane at sente.ch (=?ISO-8859-1?Q?St=E9phane_Corth=E9sy?=) Date: Fri May 4 01:03:23 2007 Subject: libjpeg In-Reply-To: References: Message-ID: <34AE05EB-7886-4863-A55A-A8B5B033FE1D@sente.ch> Hi, I did it like this (it's not a universal binary, though): libjpeg ------- # See http://www.bigbold.com/snippets/posts/show/38 curl -O http://www.ijg.org/files/jpegsrc.v6b.tar.gz gnutar xzf jpegsrc.v6b.tar.gz cd jpeg-6b cp /usr/share/libtool/config.sub . cp /usr/share/libtool/config.guess . ./configure --enable-shared --enable-static make sudo mkdir -p /usr/local/man/man1 sudo make install sudo ranlib /usr/local/lib/libjpeg.a cd .. St?phane On May 3, 2007, at 8:50 PM, J?nos wrote: > Hi, > > I am trying to create a shared library from the libjpeg source - > www.ijg.org. So in the source directory I do the following: > > bml0042:/Volumes/Data/Downloads/source/jpeg-6b janos$ ./configure -- > enable-shared > checking for gcc... gcc > checking whether the C compiler (gcc ) works... yes > checking whether the C compiler (gcc ) is a cross-compiler... no > checking whether we are using GNU C... yes > checking how to run the C preprocessor... gcc -E > checking for function prototypes... yes > checking for stddef.h... yes > checking for stdlib.h... yes > checking for string.h... yes > checking for size_t... yes > checking for type unsigned char... yes > checking for type unsigned short... yes > checking for type void... yes > checking for working const... yes > checking for inline... __inline__ > checking for broken incomplete types... ok > checking for short external names... ok > checking to see if char is signed... yes > checking to see if right shift is signed... yes > checking to see if fopen accepts b spec... yes > checking for a BSD compatible install... /usr/bin/install -c > checking for ranlib... ranlib > checking host system type... ltconfig: cannot guess host type; you > must specify one > Try `ltconfig --help' for more information. > checking libjpeg version number... 62 > creating ./config.status > creating Makefile > creating jconfig.h > > bml0042:/Volumes/Data/Downloads/source/jpeg-6b janos$ make > ./libtool --mode=compile gcc -O2 -I. -c ./jcapimin.c > make: ./libtool: Command not found > make: *** [jcapimin.lo] Error 127 > > There is no libtool in the current directory, so I try to run > ltconfig as: > > bml0042:/Volumes/Data/Downloads/source/jpeg-6b janos$ ltconfig -- > srcdir=./ --with-gcc ltmain.sh > checking host system type... ltconfig: cannot guess host type; you > must specify one > Try `ltconfig --help' for more information. > > Looking into the config.guess file I see that neither "Power > Macintosh" nor "Darwin" is there. > > If I copy over libtool from /usr/bin and try make, - probably not a > good idea - then I get this error: > > bml0042:/Volumes/Data/Downloads/source/jpeg-6b janos$ make > ./libtool --mode=compile gcc -O2 -I. -c ./jcapimin.c > ./libtool: unknown option character `-' in: --mode=compile > Usage: ./libtool -static [-] file [...] [-filelist listfile > [,dirname]] [-arch_only arch] [-sacLT] > Usage: ./libtool -dynamic [-] file [...] [-filelist listfile > [,dirname]] [-arch_only arch] [-o output] [-install_name name] [- > compatibility_version #] [-current_version #] [-seg1addr 0x#] [- > segs_read_only_addr 0x#] [-segs_read_write_addr 0x#] [- > seg_addr_table ] [-seg_addr_table_filename > ] [-all_load] [-noall_load] > make: *** [jcapimin.lo] Error 1 > > > What does it mean: "unknown option character `-' in: -- > mode=compile" ? Does it complain about -O2, or -l or -c ? > > I am looking it but not seeing it :) > > Thanks ahead, > > J?nos_______________________________________________ > MacOSX-dev mailing list > MacOSX-dev@omnigroup.com > http://www.omnigroup.com/mailman/listinfo/macosx-dev From florent.lacheroy at alwancolor.com Fri May 4 09:10:29 2007 From: florent.lacheroy at alwancolor.com (Florent Lacheroy) Date: Fri May 4 09:12:51 2007 Subject: Localization software Message-ID: <1031A86F-F403-46FE-85FF-BE1512FC6447@alwancolor.com> Hi, I'm currently looking for localization tools. I've already tested Apple recommended tools (AppleGlot, AppleTrans...) and Localization Suite 2.0 from The Blue Technologies Group. The last one looks great for me as the localization files sent to localizers embed a preview of the interface and it's easy to use. I wonder if anyone has already tested this software in depth and use it for a while? I'm also open to any other solution for localization and looking for any advice about this subject. I almost forget to say that my application is developed in Objective- C using Cocoa framework (this may be of importance :) ). Thanks, Florent. Alwan Color Expertise http://www.alwancolor.com/ From alan at apollonia.org Fri May 4 12:16:35 2007 From: alan at apollonia.org (Alan Staniforth) Date: Fri May 4 12:51:51 2007 Subject: libjpeg In-Reply-To: <34AE05EB-7886-4863-A55A-A8B5B033FE1D@sente.ch> References: <34AE05EB-7886-4863-A55A-A8B5B033FE1D@sente.ch> Message-ID: At 9:03 am +0200 4/5/07, St?phane Corth?sy wrote: >Hi, > >I did it like this (it's not a universal binary, though): [...snip...] Here's a script I used when building a universal binary of the static library for a project. I have lightly modified it with St?phane's suggestions so it plays nice with libtool and it seems to build and install a universal shared version OK. Apologies for any word wrap problems. -Alan. #!/bin/sh # # jpeg-build-univ # # Script to crteate universal binary version of libjpeg. # # ? 2006 Alan Staniforth # # Version 2.0 # # Invoke thus: # # jpeg-build-univ [-h] | [-v] | [-i] [-p prefix] [-s sdk] [-n] [-k] # # where prefix is the install root for the libraries. # # Version 2.0: # Source download incorporated. # Reverted to using MacOSX10.3.9.sdk as the default SDK for PPC # Targets 10.2 for ppc, 10.4 for i386. ### Set up. # Set trap to allow abort on signal: trap 'echo "Interrupted by signal" >&2; exit' 1 2 3 15 # Defaults BUILD_UNIV_VERS=2.0 INSTALL_PREFIX="/usr/local" SDK_PPC="MacOSX10.3.9.sdk" DO_INSTALL=0 DO_DLOAD=1 NO_SUDO=0 ### Handle optional parameters if test $# -ne 0 ; then ### Options while test $# -gt 0; do case "$1" in -*) FLAG="$1" case "$FLAG" in -h) ### Usage information echo "Usage: jpeg-build-univ [-h]" echo "Usage: jpeg-build-univ [-v]" echo "Usage: jpeg-build-univ [-i] [-p prefix] [-s sdk]" echo "" echo "Options:" echo " -h : Print this usage summary." echo " -v : Print tool version." echo " -i : Install as well as build." echo " -k : Skip download of source." echo " -n : Don't use sudo when installing." echo " -p prefix : install root for the built libraries and support" echo " files. Default is /usr/local" echo " -s sdk : the Mac OS X SDK you want GCC to use for PPC code. " echo " Default is MacOSX10.3.9.sdk" echo "" exit ;; -v) ### version echo "$BUILD_UNIV_VERS" ;; -p) ### install prefix specified shift if test "${1##*/}" = "" ; then INSTALL_PREFIX="${1%*/}" else INSTALL_PREFIX="${1}" fi if !(test -d "${INSTALL_PREFIX}") ; then echo "${INSTALL_PREFIX} does not exist or is not a directory" exit fi ;; -s) ### ppc sdk specified shift SDK_PPC="${1}" ;; -i) ### install the built libray and headers (make can't be used) DO_INSTALL=1 ;; -n) ### No sudo NO_SUDO=1 ;; -k) ### skip download DO_DLOAD=0 ;; -*) echo "Usage: "$1" not understood!" echo "Use jpeg-build-univ -h for usage information" break ;; esac ;; esac shift done fi ### Get the source: if test $DO_DLOAD -ne 0 ; then ### Download source from uunet. echo "jpeg-build-univ: Getting the libjpeg source..." curl ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v6b.tar.gz -o "jpegsrc.v6b.tar.gz" else echo "jpeg-build-univ: Skipping source download..." fi ### Extract the source: echo "jpeg-build-univ: Expanding the source tarball..." tar -zxpf jpegsrc.v6b.tar.gz ### Do set-up echo "jpeg-build-univ: Setting up..." # Change to the directory cd jpeg-6b cp /usr/share/libtool/config.sub . cp /usr/share/libtool/config.guess . # check if a relative install path was passed FIRSTCHAR=${INSTALL_PREFIX:0:1} if test $FIRSTCHAR != "/" ; then INSTALL_PREFIX="../${INSTALL_PREFIX}" fi # Ensure the support dirs exits mkdir -p build/ppc mkdir -p build/i386 ### Tidy up echo "jpeg-build-univ: Cleaning..." rm -f build/ppc/* rm -f build/i386/* if test -f Makefile ; then make distclean >/dev/null ; fi if test -f Makefile.ppc ; then rm -f Makefile.ppc ; fi if test -f Makefile.i386 ; then rm -f Makefile.i386 ; fi ### Configure echo "jpeg-build-univ: Configuring..." env CFLAGS="-O3 -g -isysroot /Developer/SDKs/$SDK_PPC -arch ppc" LDFLAGS="-Wl,-syslibroot,/Developer/SDKs/$SDK_PPC" ./configure --prefix="${INSTALL_PREFIX}" --enable-shared --disable-dependency-tracking >/dev/null ### Create the PPC Makefile echo "jpeg-build-univ: Creating PPC Makefile..." sed -e s/"CC= gcc"/"CC= \${ENVP} gcc"/ \ -e '21i\ ENVP= GCC_VERSION=3.3 MACOSX_DEPLOYMENT_TARGET=10.2 ' \ Makefile > Makefile.ppc ### Create the i386 Makefile echo "jpeg-build-univ: Creating i386 Makefile..." sed -e s/"-arch ppc"/"-arch i386"/ \ -e s/"CC= gcc"/"CC= \${ENVP} gcc"/ \ -e s/"${SDK_PPC}"/"MacOSX10.4u.sdk"/ \ -e '21i\ ENVP= MACOSX_DEPLOYMENT_TARGET=10.4 ' \ Makefile > Makefile.i386 rm ./Makefile ### Generate the i386 code echo "jpeg-build-univ: Generating i386..." cp Makefile.i386 Makefile #make clean >/dev/null #make libjpeg.la >/dev/null make >/dev/null mv .libs/*.a build/i386/ ### Generate the PPC code echo "jpeg-build-univ: Generating PPC..." cp Makefile.ppc Makefile make clean >/dev/null #make libjpeg.la >/dev/null make >/dev/null mv .libs/*.a build/ppc/ ### Build the universal libs echo "jpeg-build-univ: Building universal library..." ### Build a list of actual libraries cd ./build/ppc FLIST=`ls *.a` LIBLIST="" for f in $FLIST ; do if !(test -L $f) ; then LIBLIST="$LIBLIST $f" fi done cd ../.. for f in $LIBLIST ; do if test -f ./build/i386/$f ; then lipo -create ./build/*/$f -output .libs/$f echo "jpeg-build-univ: `file $f`" echo "jpeg-build-univ: $f is now universal." else echo "jpeg-build-univ: $f is missing from build/i386, no universal binary built." fi done if test $DO_INSTALL -ne 0 ; then echo "jpeg-build-univ: Installing..." if test $NO_SUDO -ne 0 ; then make install else sudo make install fi else echo "jpeg-build-univ: type \"make install\" to install." fi ### And exit... exit -- Alan Staniforth ** alan@apollonia.org "Meum est propositum/In taberna mori,/Ut sint vina proxima/Morientis ori." -- Anon. From bob at apple.com Fri May 4 23:19:09 2007 From: bob at apple.com (Bob Frank) Date: Fri May 4 23:19:16 2007 Subject: MEETING: Chicago CocoaHeads / CAWUG Tuesday May 8th - Input Fuzzing Message-ID: <587DE7E8-B457-44C8-8BE4-2A4BADE4626A@apple.com> Hi all, This Tuesday will be our next meeting. I will be talking about input fuzzing. The Chicago CocoaHeads / Chicago Cocoa and WebObjects User Group (CAWUG) is holding our next meeting this coming Tuesday, May 8th, at 6:00 PM at the Apple Store on Michigan Ave. PLEASE NOTE: We have a special treat this month, we get to use the Apple Store Studio space upstairs. If you don't see us, just ask any Apple Store person how to get upstairs to the Studio. Agenda: - Introductions & Announcements - Bob Frank on input fuzzing - Q & A - adjournment to O'Toole's When: Tuesday, May 8th, 6:00 PM Where: Apple Store Michigan Avenue 679 North Michigan Ave. (at the corner of Huron & Michigan Ave.) Chicago, IL 60611 http://maps.yahoo.com/maps_result? ed=gYbE5Op_0Tokf_p7h61dwjbWtjC2r1YehzWw&csz=60611 - Bob on Input Fuzzing Input fuzzing is a technique to send semi-random bad data to your application to find security vulnerabilities and crashers. I will talk about what it is and how you can fuzz your own programs to strengthen them against attacks. - O'Tooles We will continue the discussion at our local watering hold Timothy O'Toole's at 622 Fairbanks (2 blocks east of the store). We also wish to thank the folks who run the theater space at the Apple store for letting us have our meetings there, and Jonathan 'Wolf' Rentzsch for hosting the CAWUG web site and our listserve. Thanks all. Also, if you are working on a project and would like to talk about it briefly / promote it, I think it would be fun for people to hear about other people's projects. Please email me off line and you can talk at a future meeting or would like a book to review. Future meetings dates: no June Meeting due to WWDC, July 10th CAWUG Resources Web Site: http://www.cawug.org/ RSS feed: http://www.cawug.org/rss.xml Mail list: http://redshed.net/mailman/listinfo/cawug-announce iCal: http://ical.mac.com/chicagobob/ Chicago-CocoaHeads-CAWUG (view on the web) iCal: webcal://ical.mac.com/chicagobob/Chicago-CocoaHeads-CAWUG.ics (subscribe to in iCal) Cocoa Heads web site: http://cocoaheads.org/us/ChicagoIllinois/index.html Hope to see you at the meeting. -Bob From duncanc at aol.com Sat May 5 10:26:53 2007 From: duncanc at aol.com (Duncan Champney) Date: Sat May 5 10:27:09 2007 Subject: How to save current path for NSOpenPanel and NSSavePanel Message-ID: <15584414-7796-4135-954F-90EEADC8EB70@aol.com> I posted this question back in March, and still don't have a solution for it, so I am going to ask again. My application is document based, and does the normal file load/save, with little custom code from me. I also have the option to load and save "color scheme" files, which are applied to the current document. When the user asks to load a color scheme file, I create an NSOpenPanel and call runModalForDirectory, pointing it a directory that contains a list of color scheme files, and specifying only the type of file I want the user to select. The problem has to do with the default path used for opening/saving documents. I would like loading/saving color scheme files to take place in my special color schemes directory, without disturbing the directory the user last used to load/save a document. After the user loads/saves a color scheme file, the next time they try to load or save a document, the NSOpenPanel or NSSavePanel starts out in my color schemes directory instead of remembering the last place the user loaded/saved a file. I tried using the NSFileManager's currentDirectoryPath to save the current directory before invoking my load or save panel, and then restoring the current directory with changeCurrentDirectoryPath, but I gather the NSOpenPanel does not use the current directory as the starting point for file loads. Since my last post I discovered that the shared NSDocumentController's method currentDirectory gives me half of the solution, but only half. it would let me find out the current directory that the document controller will use for a document NSOpenPanel or NSSavePanel. However, I need an equivalent NSDocumentController -setCurrentDirectory call that would let me change the current directory, and there does not appear to be such a call. For document loads/saves, the NSDocumentController invokes NSOpenPanel and NSSavePanel in response to my file menu's open and save menu commands (which send the normal nil targeted actions openDocument and saveDocument) I've dug through the electronic documentation at length, and poured through several print cocoa programming guides, but can't figure out how to do this. Can somebody help? Thanks in advance. Duncan C From duncanc at aol.com Sat May 5 10:27:01 2007 From: duncanc at aol.com (Duncan Champney) Date: Sat May 5 10:27:12 2007 Subject: Is there an NSThread equivalent of suspend/resume? Message-ID: <3E3436C3-B93D-4021-B936-806B44661C08@aol.com> My application uses a very simple form of multithreading in order to detach multiple rendering threads for rendering fractal images. I create an array of rendering "tasks", and then detach as many rendering threads as there are processors on the target machine. (I don't mean "tasks" in the sense of NSTask instances. I'm using the term informally to describe a unit of work for my application to perform.) When a thread completes, It shuts down. My main thread then takes another rendering task from the task array and detaches a new rendering thread to compute that "task." Thus, for a plot that has a large number of rendering tasks, my application detaches and releases rendering threads repeatedly. There is a fair amount of overhead in detaching and releasing threads. I would like to avoid that overhead. I also am adding a feature to my app that will require allocating large memory structures for each rendering thread. I will allocate a memory structure for each rendering thread, and want that structure to be used to process all the rendering tasks in my task array. I want to re-factor my code so that instead of releasing my rendering threads once they finish a rendering task, they go to sleep or are suspended until they are given another rendering task. My main thread would then release them once the plot is completed. I want to minimize/eliminate the amount of CPU time that idle compute threads take, while reducing the amount of latency before a rendering thread wakes up and begins a new rendering task. I could add nanosleep calls to a rendering thread's run loop, so that it sleeps for brief intervals before checking for a new rendering task. However this approach would mean that the rendering task might take as long as the full sleep interval before it "wakes up" and begins processing it's new rendering task. If I used too large an interval, I would introduce lag time before a thread wakes up and begin processing a new task. If I use too short an interval, my threads would waste CPU time needlessly as they go to sleep, wake up, find that there is nothing to do, and go back to sleep again. The ideal sleep interval would probably be different for different machines, and might even vary depending on what else the machine was doing. Ideally, I'd like to have my main thread suspend a rendering thread after it completes, and then resume it once it has queued up a new rendering task. I couldn't find support for this in the documentation for threads. Is there an equivalent of suspend/resume calls for threads as opposed to NSTasks? If so, what are the calls and where are they documented? Some sort of "wake early" call would also solve my problem (a call, performed from the main thread, that would wake a rendering thread from sleep before its sleep interval had elapsed) Duncan C From shawnce at gmail.com Sat May 5 11:20:02 2007 From: shawnce at gmail.com (Shawn Erickson) Date: Sat May 5 11:20:10 2007 Subject: Is there an NSThread equivalent of suspend/resume? In-Reply-To: <3E3436C3-B93D-4021-B936-806B44661C08@aol.com> References: <3E3436C3-B93D-4021-B936-806B44661C08@aol.com> Message-ID: On 5/5/07, Duncan Champney wrote: > Ideally, I'd like to have my main thread suspend a rendering thread > after it completes, and then resume it once it has queued up a new > rendering task. Sounds like you are talking about implementing a thread pool that maintains some number of worker threads that pull work off of a work queue. You can find examples of ones ready to be used and written in Cocoa/Objective-C. Anyways one way to go about this is to simply have your worker thread run a while loop and in the while loop have the thread block waiting for work to become available. When work becomes available the thread unblocks, does the requested work, and then loops around again blocking while waiting for more work (or exits if asked to die). Using NSCondition, NSConditionLock, and/or NSRunloops with event source you can implement this behavior without much work. In other words you are looking at a producer /consumer pattern with multiple persistent consumers. From kusterer at gmail.com Sat May 5 12:04:34 2007 From: kusterer at gmail.com (Uli Kusterer) Date: Sat May 5 12:04:58 2007 Subject: How to save current path for NSOpenPanel and NSSavePanel In-Reply-To: <15584414-7796-4135-954F-90EEADC8EB70@aol.com> References: <15584414-7796-4135-954F-90EEADC8EB70@aol.com> Message-ID: <9BFC889D-39DE-45B5-A29A-E37EF638EB48@gmail.com> On 05.05.2007, at 19:26, Duncan Champney wrote: > Since my last post I discovered that the shared > NSDocumentController's method currentDirectory gives me half of the > solution, but only half. it would let me find out the current > directory that the document controller will use for a document > NSOpenPanel or NSSavePanel. However, I need an equivalent > NSDocumentController -setCurrentDirectory call that would let me > change the current directory, and there does not appear to be such > a call. I think NSDocument has a method that lets you look at and mess with an open/save panel before it gets displayed. Have you looked there? Cheers, -- M. Uli Kusterer http://www.zathras.de From duncanc at aol.com Sat May 5 13:04:49 2007 From: duncanc at aol.com (Duncan Champney) Date: Sat May 5 13:04:52 2007 Subject: How to save current path for NSOpenPanel and NSSavePanel In-Reply-To: <9BFC889D-39DE-45B5-A29A-E37EF638EB48@gmail.com> References: <15584414-7796-4135-954F-90EEADC8EB70@aol.com> <9BFC889D-39DE-45B5-A29A-E37EF638EB48@gmail.com> Message-ID: <2DCA2742-46DA-4D8A-B690-2719D8064943@aol.com> On May 5, 2007, at 3:04 PM, Uli Kusterer wrote: > On 05.05.2007, at 19:26, Duncan Champney wrote: >> Since my last post I discovered that the shared >> NSDocumentController's method currentDirectory gives me half of >> the solution, but only half. it would let me find out the current >> directory that the document controller will use for a document >> NSOpenPanel or NSSavePanel. However, I need an equivalent >> NSDocumentController -setCurrentDirectory call that would let me >> change the current directory, and there does not appear to be such >> a call. > > I think NSDocument has a method that lets you look at and mess with > an open/save panel before it gets displayed. Have you looked there? > There's a method in NSDocument, -prepareSavePanel, that's intended to let you customize the save panel. I could probably override that method in my document, and use it to remember the current path. However, it would let me record the current directory BEFORE the user saved, not the current directory AFTER the user dismisses the save panel. That still leaves me with the file open case. For file open, there is no associated NSDocument object. It's handled by the shared NSDocumentController. Thinking out loud, I might be able to override the NSDocumentController's -runModalOpenPanel method to set the directory used by the NSOpenPanel, and to remember the directory the user selected. However, I've never tried to subclass a shared single- instance object like the shared document controller before, and am not sure how to go about it. It seems like my situation can't be unique. What do other developers do when they want to use NSOpenPanel and NSSavePanel for opening and saving non document files inside their document-based applications? > Cheers, > -- M. Uli Kusterer > http://www.zathras.de > > > From cmhofman at gmail.com Sat May 5 13:21:12 2007 From: cmhofman at gmail.com (Christiaan Hofman) Date: Sat May 5 13:21:19 2007 Subject: How to save current path for NSOpenPanel and NSSavePanel In-Reply-To: <2DCA2742-46DA-4D8A-B690-2719D8064943@aol.com> References: <15584414-7796-4135-954F-90EEADC8EB70@aol.com> <9BFC889D-39DE-45B5-A29A-E37EF638EB48@gmail.com> <2DCA2742-46DA-4D8A-B690-2719D8064943@aol.com> Message-ID: <871BBC93-267D-4369-9657-13E4F4C094E3@gmail.com> On 5 May 2007, at 10:04 PM, Duncan Champney wrote: > > On May 5, 2007, at 3:04 PM, Uli Kusterer wrote: > >> On 05.05.2007, at 19:26, Duncan Champney wrote: >>> Since my last post I discovered that the shared >>> NSDocumentController's method currentDirectory gives me half of >>> the solution, but only half. it would let me find out the current >>> directory that the document controller will use for a document >>> NSOpenPanel or NSSavePanel. However, I need an equivalent >>> NSDocumentController -setCurrentDirectory call that would let me >>> change the current directory, and there does not appear to be >>> such a call. >> >> I think NSDocument has a method that lets you look at and mess >> with an open/save panel before it gets displayed. Have you looked >> there? >> > > > There's a method in NSDocument, -prepareSavePanel, that's intended > to let you customize the save panel. I could probably override that > method in my document, and use it to remember the current path. > However, it would let me record the current directory BEFORE the > user saved, not the current directory AFTER the user dismisses the > save panel. > > That still leaves me with the file open case. For file open, there > is no associated NSDocument object. It's handled by the shared > NSDocumentController. > > Thinking out loud, I might be able to override the > NSDocumentController's -runModalOpenPanel method to set the > directory used by the NSOpenPanel, and to remember the directory > the user selected. However, I've never tried to subclass a shared > single-instance object like the shared document controller before, > and am not sure how to go about it. > That's easy (at least for NSDocumentController). Just make sure your subclass is instantiated before NSApplication attempts to access the documentController. The shared instance is always the first instance of NSDocumentController or a subclass that is created. E.g. you can instantiate a subclass in MainMenu.nib. Christiaan > It seems like my situation can't be unique. What do other > developers do when they want to use NSOpenPanel and NSSavePanel for > opening and saving non document files inside their document-based > applications? >> Cheers, >> -- M. Uli Kusterer >> http://www.zathras.de >> Note that the open/save panel for documents try to use the last directory used for saving a document, /before/ using the last directory from the open/savePanel. So your problem would only appear before the first time you save any document; so it's not that serious. Also, I think you could mess with the prefs (I think it's NSNavPanelLastRootDirectory). But I don't know if it works and if it would have side effects (it is an undocumented pref, so the same provisions should be true as for using private methods). Christiaan From cmh at mac.com Sun May 6 22:58:26 2007 From: cmh at mac.com (Chris Hanson) Date: Sun May 6 22:58:36 2007 Subject: Is there an NSThread equivalent of suspend/resume? In-Reply-To: <3E3436C3-B93D-4021-B936-806B44661C08@aol.com> References: <3E3436C3-B93D-4021-B936-806B44661C08@aol.com> Message-ID: On May 5, 2007, at 10:27 AM, Duncan Champney wrote: > Ideally, I'd like to have my main thread suspend a rendering thread > after it completes, and then resume it once it has queued up a new > rendering task. I couldn't find support for this in the > documentation for threads. Is there an equivalent of suspend/resume > calls for threads as opposed to NSTasks? If so, what are the calls > and where are they documented? Some sort of "wake early" call would > also solve my problem (a call, performed from the main thread, that > would wake a rendering thread from sleep before its sleep interval > had elapsed) There is not. Fine-grained manipulation of threads -- for example, suspending them, resuming them, canceling/killing them, and so on -- is ***almost always*** incorrect and it's good not to have APIs for people to abuse in this fashion. What you're describing is a classic producer/consumer problem, well- described in the multiprogramming literature for the past 40 years or so. The standard solution to this is to have the producer place work items in a queue that the consumers block on when they are not performing the requested work. When an item is placed in the queue, one of the consumers blocked on the queue is unblocked, removes the item, and processes it. In Cocoa, this can be done easily by simply creating several worker threads and sharing an NSMutableArray protected by an NSConditionLock. (People usually combine the array and the lock into their own WorkQueue class, of course.) http://www.cocoadev.com/index.pl?ProducersAndConsumerModel Try the easiest solution first, obviously. Don't immediately try to go beyond the first example (ThreadSafeQueue) on that page, since you should understand thoroughly why the first example works before attempting anything else. You probably won't even need anything beyond the first example -- I've never needed more than an equivalent class I wrote five years ago at MacHack for my "stream a fake screen over the network" hack. -- Chris From ben at tanjero.com Mon May 7 18:26:53 2007 From: ben at tanjero.com (Benjamin Stiglitz) Date: Mon May 7 18:27:03 2007 Subject: Is there an NSThread equivalent of suspend/resume? In-Reply-To: <3E3436C3-B93D-4021-B936-806B44661C08@aol.com> References: <3E3436C3-B93D-4021-B936-806B44661C08@aol.com> Message-ID: > Ideally, I'd like to have my main thread suspend a rendering thread > after it completes, and then resume it once it has queued up a new > rendering task. I couldn't find support for this in the > documentation for threads. Is there an equivalent of suspend/resume > calls for threads as opposed to NSTasks? If so, what are the calls > and where are they documented? Some sort of "wake early" call would > also solve my problem (a call, performed from the main thread, that > would wake a rendering thread from sleep before its sleep interval > had elapsed) Check out NSConditionLock. You can have your app lock and unlock when there?s data ready. -Ben From llothar at web.de Tue May 8 02:38:28 2007 From: llothar at web.de (Lothar Scholz) Date: Tue May 8 02:38:36 2007 Subject: IB handling question Message-ID: <352883062.20070508163828@web.de> Hello macosx-dev, I have a complex dialog with an outline on the left side and 4 different tab widgets on the right (each with a lot of tab items and subwidgets). Based on what item is selected in the outline one of the tab widgets needs to be displayed and the other 3 needs to be hidden. My question is just about how to handle work with IB to get the layout of the widgets correct. Working with multiple stacked widgets in a pain because there seems to be no Z-order in IB. I can't select an item and make it the foreground item. When i check the hidden attribute in the inspector it does not also not help. So at the moment i tried to design one of the layer, then move it to a corner of the window, design the next layer and so on and then move this back when the whole design is done. But it is a terrible pain in the ass and costs me a lot more time then what i have to do for the other plattforms. The more i try IB the more i see it is not useable for more complex and dynamic dialogs (when widgets are added/shown or removed/hidden during runtime). Is there any alternative to IB for GUI design. Is there some layout manager based library (either for cocoa or carbon)? -- Best regards, Lothar mailto:llothar@web.de From fcv at dev6.com Tue May 8 03:07:05 2007 From: fcv at dev6.com (Filipe Varela) Date: Tue May 8 03:54:16 2007 Subject: IB handling question In-Reply-To: <352883062.20070508163828@web.de> References: <352883062.20070508163828@web.de> Message-ID: IB can do all that and much more. Place the tab views in separate NSView instances and leave the outline along with a "destinationView" in the dialog. Destination view should resize to whatever is needed to draw the biggest tab. Upon changing selection in the outline, make the tab view draw in the destinationView. The problem is not IB or its capabilities. You need to think cocoa :) Filipe On 2007/05/08, at 10:38, Lothar Scholz wrote: > Hello macosx-dev, > > I have a complex dialog with an outline on the left side and 4 > different > tab widgets on the right (each with a lot of tab items and > subwidgets). > Based on what item is selected in the outline one of the tab widgets > needs to be displayed and the other 3 needs to be hidden. > > My question is just about how to handle work with IB to get the layout > of the widgets correct. Working with multiple stacked widgets in a > pain because there seems to be no Z-order in IB. I can't select > an item and make it the foreground item. When i check the hidden > attribute in the inspector it does not also not help. So at the moment > i tried to design one of the layer, then move it to a corner of the > window, design the next layer and so on and then move this back when > the whole design is done. > > But it is a terrible pain in the ass and costs me a lot more time > then what i have to do for the other plattforms. > > The more i try IB the more i see it is not useable for more complex > and dynamic dialogs (when widgets are added/shown or removed/hidden > during runtime). Is there any alternative to IB for GUI design. Is > there some layout manager based library (either for cocoa or carbon)? > > -- > Best regards, > Lothar mailto:llothar@web.de > > _______________________________________________ > MacOSX-dev mailing list > MacOSX-dev@omnigroup.com > http://www.omnigroup.com/mailman/listinfo/macosx-dev From cmhofman at gmail.com Tue May 8 04:16:39 2007 From: cmhofman at gmail.com (Christiaan Hofman) Date: Tue May 8 04:16:56 2007 Subject: IB handling question In-Reply-To: References: <352883062.20070508163828@web.de> Message-ID: <27EEB29E-1FAF-474C-BF17-0FB560312530@gmail.com> One additional tip (to make the remark "make the tab view draw in the destinationView" more concrete): make the destinationView a (tabless) tab view, and add your tab views in its tab view items. Christiaan On 8 May 2007, at 12:07 PM, Filipe Varela wrote: > IB can do all that and much more. Place the tab views in separate > NSView instances and leave the outline along with a > "destinationView" in the dialog. Destination view should resize to > whatever is needed to draw the biggest tab. Upon changing selection > in the outline, make the tab view draw in the destinationView. > > The problem is not IB or its capabilities. You need to think cocoa :) > > Filipe > > On 2007/05/08, at 10:38, Lothar Scholz wrote: >> Hello macosx-dev, >> >> I have a complex dialog with an outline on the left side and 4 >> different >> tab widgets on the right (each with a lot of tab items and >> subwidgets). >> Based on what item is selected in the outline one of the tab widgets >> needs to be displayed and the other 3 needs to be hidden. >> >> My question is just about how to handle work with IB to get the >> layout >> of the widgets correct. Working with multiple stacked widgets in a >> pain because there seems to be no Z-order in IB. I can't select >> an item and make it the foreground item. When i check the hidden >> attribute in the inspector it does not also not help. So at the >> moment >> i tried to design one of the layer, then move it to a corner of the >> window, design the next layer and so on and then move this back when >> the whole design is done. >> >> But it is a terrible pain in the ass and costs me a lot more time >> then what i have to do for the other plattforms. >> >> The more i try IB the more i see it is not useable for more complex >> and dynamic dialogs (when widgets are added/shown or removed/hidden >> during runtime). Is there any alternative to IB for GUI design. Is >> there some layout manager based library (either for cocoa or carbon)? >> >> -- >> Best regards, >> Lothar mailto:llothar@web.de From fcv at dev6.com Tue May 8 05:52:26 2007 From: fcv at dev6.com (Filipe Varela) Date: Tue May 8 05:52:44 2007 Subject: IB handling question In-Reply-To: <27EEB29E-1FAF-474C-BF17-0FB560312530@gmail.com> References: <352883062.20070508163828@web.de> <27EEB29E-1FAF-474C-BF17-0FB560312530@gmail.com> Message-ID: <5D4019B3-DA4B-459F-9485-58BB0520BF1B@dev6.com> You're right Christiaan. My bad! I can't seem to memorize that tabless tab views exist lol! Filipe On 2007/05/08, at 12:16, Christiaan Hofman wrote: > One additional tip (to make the remark "make the tab view draw in > the destinationView" more concrete): make the destinationView a > (tabless) tab view, and add your tab views in its tab view items. > > Christiaan > > On 8 May 2007, at 12:07 PM, Filipe Varela wrote: > >> IB can do all that and much more. Place the tab views in separate >> NSView instances and leave the outline along with a >> "destinationView" in the dialog. Destination view should resize to >> whatever is needed to draw the biggest tab. Upon changing >> selection in the outline, make the tab view draw in the >> destinationView. >> >> The problem is not IB or its capabilities. You need to think cocoa :) >> >> Filipe >> >> On 2007/05/08, at 10:38, Lothar Scholz wrote: >>> Hello macosx-dev, >>> >>> I have a complex dialog with an outline on the left side and 4 >>> different >>> tab widgets on the right (each with a lot of tab items and >>> subwidgets). >>> Based on what item is selected in the outline one of the tab widgets >>> needs to be displayed and the other 3 needs to be hidden. >>> >>> My question is just about how to handle work with IB to get the >>> layout >>> of the widgets correct. Working with multiple stacked widgets in a >>> pain because there seems to be no Z-order in IB. I can't select >>> an item and make it the foreground item. When i check the hidden >>> attribute in the inspector it does not also not help. So at the >>> moment >>> i tried to design one of the layer, then move it to a corner of the >>> window, design the next layer and so on and then move this back when >>> the whole design is done. >>> >>> But it is a terrible pain in the ass and costs me a lot more time >>> then what i have to do for the other plattforms. >>> >>> The more i try IB the more i see it is not useable for more complex >>> and dynamic dialogs (when widgets are added/shown or removed/hidden >>> during runtime). Is there any alternative to IB for GUI design. Is >>> there some layout manager based library (either for cocoa or >>> carbon)? >>> >>> -- >>> Best regards, >>> Lothar mailto:llothar@web.de > > > _______________________________________________ > MacOSX-dev mailing list > MacOSX-dev@omnigroup.com > http://www.omnigroup.com/mailman/listinfo/macosx-dev From bob at apple.com Tue May 8 13:17:09 2007 From: bob at apple.com (Bob Frank) Date: Tue May 8 13:17:16 2007 Subject: MEETING: Chicago CocoaHeads / CAWUG Tuesday May 8th - Input Fuzzing In-Reply-To: <587DE7E8-B457-44C8-8BE4-2A4BADE4626A@apple.com> References: <587DE7E8-B457-44C8-8BE4-2A4BADE4626A@apple.com> Message-ID: <888942A7-4E66-4168-AFA7-ED8F96A32791@apple.com> Hi All, It turns out that we'll be in the Theater tonight after all, so don't go up to the studio. See you there tonight. -Bob On May 5, 2007, at 1:19 AM, Bob Frank wrote: > Hi all, > > This Tuesday will be our next meeting. I will be talking about > input fuzzing. The Chicago CocoaHeads / Chicago Cocoa and > WebObjects User Group (CAWUG) is holding our next meeting this > coming Tuesday, May 8th, at 6:00 PM at the Apple Store on Michigan > Ave. > > > PLEASE NOTE: > > We have a special treat this month, we get to use the > Apple Store Studio space upstairs. > If you don't see us, just ask any Apple Store person how > to get upstairs to the Studio. > > > Agenda: > - Introductions & Announcements > - Bob Frank on input fuzzing > - Q & A > - adjournment to O'Toole's > > When: > Tuesday, May 8th, 6:00 PM > > Where: > Apple Store Michigan Avenue > 679 North Michigan Ave. (at the corner of Huron & Michigan Ave.) > Chicago, IL 60611 > http://maps.yahoo.com/maps_result? > ed=gYbE5Op_0Tokf_p7h61dwjbWtjC2r1YehzWw&csz=60611 > > > > > - Bob on Input Fuzzing > > Input fuzzing is a technique to send semi-random bad data to your > application to find security vulnerabilities and crashers. I will > talk about what it is and how you can fuzz your own programs to > strengthen them against attacks. > > > - O'Tooles > We will continue the discussion at our local watering hold Timothy > O'Toole's at 622 Fairbanks (2 blocks east of the store). > > > We also wish to thank the folks who run the theater space at the > Apple store for letting us have our meetings there, and Jonathan > 'Wolf' Rentzsch for hosting the CAWUG web site and our listserve. > Thanks all. > > Also, if you are working on a project and would like to talk about > it briefly / promote it, I think it would be fun for people to > hear about other people's projects. Please email me off line and > you can talk at a future meeting or would like a book to review. > > Future meetings dates: no June Meeting due to WWDC, July 10th > > > > CAWUG Resources > > Web Site: http://www.cawug.org/ > RSS feed: http://www.cawug.org/rss.xml > Mail list: http://redshed.net/mailman/listinfo/cawug-announce > iCal: http://ical.mac.com/chicagobob/ Chicago-CocoaHeads-CAWUG > (view on the web) > iCal: webcal://ical.mac.com/chicagobob/Chicago-CocoaHeads- > CAWUG.ics (subscribe to in iCal) > > Cocoa Heads web site: > http://cocoaheads.org/us/ChicagoIllinois/index.html > > Hope to see you at the meeting. > > -Bob > --- Bob Frank (312) 961 - 0509 [cell] bob@apple.com From duncanc at aol.com Tue May 8 14:07:41 2007 From: duncanc at aol.com (Duncan Champney) Date: Tue May 8 14:07:50 2007 Subject: Is there an NSThread equivalent of suspend/resume? -ThreadSafeQueue In-Reply-To: References: <3E3436C3-B93D-4021-B936-806B44661C08@aol.com> Message-ID: <9F37E969-AD83-4E4E-A31D-071BC09D5E21@aol.com> On May 7, 2007, at 1:58 AM, Chris Hanson wrote: > On May 5, 2007, at 10:27 AM, Duncan Champney wrote: > >> Ideally, I'd like to have my main thread suspend a rendering >> thread after it completes, and then resume it once it has queued >> up a new rendering task. I couldn't find support for this in the >> documentation for threads. Is there an equivalent of suspend/ >> resume calls for threads as opposed to NSTasks? If so, what are >> the calls and where are they documented? Some sort of "wake early" >> call would also solve my problem (a call, performed from the main >> thread, that would wake a rendering thread from sleep before its >> sleep interval had elapsed) > > There is not. Fine-grained manipulation of threads -- for example, > suspending them, resuming them, canceling/killing them, and so on > -- is ***almost always*** incorrect and it's good not to have APIs > for people to abuse in this fashion. > > What you're describing is a classic producer/consumer problem, well- > described in the multiprogramming literature for the past 40 years > or so. The standard solution to this is to have the producer > place work items in a queue that the consumers block on when they > are not performing the requested work. When an item is placed in > the queue, one of the consumers blocked on the queue is unblocked, > removes the item, and processes it. > > In Cocoa, this can be done easily by simply creating several worker > threads and sharing an NSMutableArray protected by an > NSConditionLock. (People usually combine the array and the lock > into their own WorkQueue class, of course.) > > http://www.cocoadev.com/index.pl?ProducersAndConsumerModel > > Try the easiest solution first, obviously. Don't immediately try > to go beyond the first example (ThreadSafeQueue) on that page, > since you should understand thoroughly why the first example works > before attempting anything else. You probably won't even need > anything beyond the first example -- I've never needed more than an > equivalent class I wrote five years ago at MacHack for my "stream a > fake screen over the network" hack. > > -- Chris > Chris, Your point about this being a common, well-documented problem in multiprocessing is well taken. I was focusing on platform-specific documentation, and should have researched the computer science aspects of it as well. Can you recommend a good overview of multiprogramming? It's not easy to sift through all the available reference material and find something relevant. Thanks for the suggestion on NSConditionLock, and the link to the ThreadSafeQueue. I've since done a little reading on the producer/consumer model. Aren't the worker threads that are generating data the "producers" in this model, and the main app that takes the finished data the consumer? Thus, I think you had your terms backwards above when you said: > The standard solution to this is to have the producer place work > items in a queue that the consumers block on when they are not > performing the requested work. When an item is placed in the > queue, one of the consumers blocked on the queue is unblocked, > removes the item, and processes it. In my app, I want my worker threads to run through processing jobs until the job queue is empty. The main thread doesn't care what order the jobs are completed in, and it has work to do while the worker threads are running (responding to the user and displaying the partially completed plot data from the worker thread(s). Right now, my main thread is in charge of spawning worker threads and giving them jobs from the job queue to perform. I think I am going to refactor my code so that my main thread simply spawns as many threads as there are processors on the machine. Each worker thread will then put a lock on the job queue, take a job off the job the job queue, then release the lock on the job queue and begin processing the job. When the job queue is empty, my worker threads will terminate. I don't need for my worker threads to persist after the job queue is empty. As you say, the ThreadSafeQueue class you reference will basically meet my needs. I'd just need to change it slightly so that it doesn't block when the queue is empty. My worker threads would simply terminate when they are told the job queue is empty. Duncan C From edenwaith at mac.com Tue May 15 05:57:30 2007 From: edenwaith at mac.com (Chad Armstrong) Date: Tue May 15 05:57:40 2007 Subject: Integration Automator Action into project In-Reply-To: <20070507190005.0726C174CBD@forums.omnigroup.com> References: <20070507190005.0726C174CBD@forums.omnigroup.com> Message-ID: Hello: I'm developing several Automator Actions. I'm creating each action by creating a new project and selecting a Cocoa-based Automator Action. This is working out OK for me right now. What I want to know, what is the best way to integrate these Automator actions into my main application in Xcode, so they will be stored in MyApp.app/Contents/Library/Automator? Regards, Chad From cmhofman at gmail.com Tue May 15 06:13:57 2007 From: cmhofman at gmail.com (Christiaan Hofman) Date: Tue May 15 06:14:08 2007 Subject: Integration Automator Action into project In-Reply-To: References: <20070507190005.0726C174CBD@forums.omnigroup.com> Message-ID: 1. Link the xcode project files of the Automator actions in your app's project file (you may want to create a group for them). 2. Add a new Copy Files build phase to your app's target, Destination = Wrapper, Path = Contents/Library/Automator. 3. Drag the products from the linked xcode projects to this target. 4. (optional but advisable) add those products as direct dependencies to your app's target. Christiaan On 15 May 2007, at 2:57 PM, Chad Armstrong wrote: > Hello: > > I'm developing several Automator Actions. I'm creating each action > by creating a new project and selecting a Cocoa-based Automator > Action. This is working out OK for me right now. > > What I want to know, what is the best way to integrate these > Automator actions into my main application in Xcode, so they will > be stored in MyApp.app/Contents/Library/Automator? > > Regards, > > Chad From duncanc at aol.com Tue May 15 16:08:27 2007 From: duncanc at aol.com (Duncan Champney) Date: Tue May 15 16:08:39 2007 Subject: Follow-up questions on sample class ThreadSafeQueue In-Reply-To: References: <3E3436C3-B93D-4021-B936-806B44661C08@aol.com> Message-ID: Chris, Thanks for the link to the ThreadSafeQueue post. It makes good sense to me to use NSConditionLock to manage shared access to a job queue. I have a couple of follow-up questions. I'm a little unclear on how the worker threads would use the ThreadSafeQueue. I would think the ThreadSafeQueue object's methods would run on the main thread, and the worker threads would call those methods using performSelectorOnMainThread. But that method has a void return value. I think I must be misunderstanding something. Also, I'm puzzled by a couple of lines in the method implementation. Why do the methods in -dequeue and -tryDequeue retain and autorelease the object from "elements" in the same call. Here's the line from tryDequeue: element = [[[elements objectAtIndex:0] retain] autorelease]; The retain and autorelease calls would seem to cancel each other out. The retain call would increase the retain count for the object in "elements", and then the autorelease would immediately decrement it, for a net null effect. Duncan C --- On May 7, 2007, at 1:58 AM, Chris Hanson wrote: > On May 5, 2007, at 10:27 AM, Duncan Champney wrote: > >> Ideally, I'd like to have my main thread suspend a rendering >> thread after it completes, and then resume it once it has queued >> up a new rendering task. I couldn't find support for this in the >> documentation for threads. Is there an equivalent of suspend/ >> resume calls for threads as opposed to NSTasks? If so, what are >> the calls and where are they documented? Some sort of "wake early" >> call would also solve my problem (a call, performed from the main >> thread, that would wake a rendering thread from sleep before its >> sleep interval had elapsed) > > There is not. Fine-grained manipulation of threads -- for example, > suspending them, resuming them, canceling/killing them, and so on > -- is ***almost always*** incorrect and it's good not to have APIs > for people to abuse in this fashion. > > What you're describing is a classic producer/consumer problem, well- > described in the multiprogramming literature for the past 40 years > or so. The standard solution to this is to have the producer > place work items in a queue that the consumers block on when they > are not performing the requested work. When an item is placed in > the queue, one of the consumers blocked on the queue is unblocked, > removes the item, and processes it. > > In Cocoa, this can be done easily by simply creating several worker > threads and sharing an NSMutableArray protected by an > NSConditionLock. (People usually combine the array and the lock > into their own WorkQueue class, of course.) > > http://www.cocoadev.com/index.pl?ProducersAndConsumerModel > > Try the easiest solution first, obviously. Don't immediately try > to go beyond the first example (ThreadSafeQueue) on that page, > since you should understand thoroughly why the first example works > before attempting anything else. You probably won't even need > anything beyond the first example -- I've never needed more than an > equivalent class I wrote five years ago at MacHack for my "stream a > fake screen over the network" hack. > > -- Chris > From jim.correia at pobox.com Tue May 15 16:23:52 2007 From: jim.correia at pobox.com (Jim Correia) Date: Tue May 15 16:24:01 2007 Subject: Follow-up questions on sample class ThreadSafeQueue In-Reply-To: References: <3E3436C3-B93D-4021-B936-806B44661C08@aol.com> Message-ID: <7C88E112-9264-4F6B-8FE8-0E1B7CC33D25@pobox.com> On May 15, 2007, at 7:08 PM, Duncan Champney wrote: > I'm a little unclear on how the worker threads would use the > ThreadSafeQueue. I would think the ThreadSafeQueue object's methods > would run on the main thread, and the worker threads would call > those methods using performSelectorOnMainThread. But that method > has a void return value. I think I must be misunderstanding something. Typically your worker thread will have a work loop like this: id object; while (nil != (object = [workQueue dequeueObject]) { do work on object } dequeueObject blocks until an object is available. > Also, I'm puzzled by a couple of lines in the method > implementation. Why do the methods in -dequeue and -tryDequeue > retain and autorelease the object from "elements" in the same call. > Here's the line from tryDequeue: > > element = [[[elements objectAtIndex:0] retain] autorelease]; > > The retain and autorelease calls would seem to cancel each other > out. The retain call would increase the retain count for the object > in "elements", and then the autorelease would immediately decrement > it, for a net null effect. I'd encourage you to re-study the Cocoa object ownership rules. autorelease means release later, when the enclosing autorelease pool is popped. Since the dequeue method removes the object from the array, it has to extend its lifetime in order to return it to the caller. It does so by sending retain, followed by autorelease. Jim From shawnce at gmail.com Tue May 15 16:37:41 2007 From: shawnce at gmail.com (Shawn Erickson) Date: Tue May 15 16:37:50 2007 Subject: Follow-up questions on sample class ThreadSafeQueue In-Reply-To: References: <3E3436C3-B93D-4021-B936-806B44661C08@aol.com> Message-ID: On 5/15/07, Duncan Champney wrote: > Chris, > > Thanks for the link to the ThreadSafeQueue post. It makes good sense > to me to use NSConditionLock to manage shared access to a job queue. > > I have a couple of follow-up questions. > > I'm a little unclear on how the worker threads would use the > ThreadSafeQueue. I would think the ThreadSafeQueue object's methods > would run on the main thread, and the worker threads would call those > methods using performSelectorOnMainThread. Why do you think that? The whole point of the class is to allow multiple threads to utilize the same queue directly. That is why it uses NSConditionLock to protect the data structure it manages. > Also, I'm puzzled by a couple of lines in the method implementation. > Why do the methods in -dequeue and -tryDequeue retain and autorelease > the object from "elements" in the same call. Here's the line from > tryDequeue: > > element = [[[elements objectAtIndex:0] retain] autorelease]; That retains the objects and balances that retain with an autorelease. That ensures that the object will continue to exist at least until sometime in the future when the current autorelease pool is released (drained). Why is this done? Well the removeObjectAtIndex: message could result in the "element" object being deallocated because the elements array could be the last object holding a retain on "element". > The retain and autorelease calls would seem to cancel each other out. That is true but not immediately. > The retain call would increase the retain count for the object in > "elements", and then the autorelease would immediately decrement it, > for a net null effect. No autorelease doesn't immediately decrement the retain count. Review the concept of NSAutoreleasePools. -Shawn From duncanc at aol.com Tue May 15 17:32:09 2007 From: duncanc at aol.com (Duncan Champney) Date: Tue May 15 17:32:13 2007 Subject: Follow-up questions on sample class ThreadSafeQueue In-Reply-To: References: <3E3436C3-B93D-4021-B936-806B44661C08@aol.com> Message-ID: <2BD43FAA-ED45-4683-B307-EF63BE905D9F@aol.com> On May 15, 2007, at 7:37 PM, Shawn Erickson wrote: > On 5/15/07, Duncan Champney wrote: >> Chris, >> >> Thanks for the link to the ThreadSafeQueue post. It makes good sense >> to me to use NSConditionLock to manage shared access to a job queue. >> >> I have a couple of follow-up questions. >> >> I'm a little unclear on how the worker threads would use the >> ThreadSafeQueue. I would think the ThreadSafeQueue object's methods >> would run on the main thread, and the worker threads would call those >> methods using performSelectorOnMainThread. > > Why do you think that? The whole point of the class is to allow > multiple threads to utilize the same queue directly. That is why it > uses NSConditionLock to protect the data structure it manages. Shawn, Thanks for the reply. I'm still trying to wrap my head around the subtleties of multi-threading. I understand you now. > >> Also, I'm puzzled by a couple of lines in the method implementation. >> Why do the methods in -dequeue and -tryDequeue retain and autorelease >> the object from "elements" in the same call. Here's the line from >> tryDequeue: >> >> element = [[[elements objectAtIndex:0] retain] autorelease]; > > That retains the objects and balances that retain with an autorelease. > That ensures that the object will continue to exist at least until > sometime in the future when the current autorelease pool is released > (drained). > > Why is this done? Well the removeObjectAtIndex: message could result > in the "element" object being deallocated because the elements array > could be the last object holding a retain on "element". > >> The retain and autorelease calls would seem to cancel each other out. > > That is true but not immediately. > >> The retain call would increase the retain count for the object in >> "elements", and then the autorelease would immediately decrement it, >> for a net null effect. > > No autorelease doesn't immediately decrement the retain count. Review > the concept of NSAutoreleasePools. I just did what you suggested and read the description of NSAutoreleasePool VERY carefully. The point I didn't understand before was that only an app's main thread automatically releases objects in the autorelease pool (when deallocating the autoreleasePool on the next pass through the event loop.) Secondary threads don't release objects in their autorelease pools automatically - they have to deallocate their autorelease pools explicitly in order for the objects in the pool to be released. Here's the relevant text: NSAutoreleasePool objects are automatically created and destroyed in the main thread of applications based on the Application Kit, so your code normally does not have to deal with them. The Application Kit creates a pool at the beginning of the event loop and releases it at the end, thereby periodically releasing any autoreleased objects generated while processing events. Thus when you execute the example statement I gave before element = [[[elements objectAtIndex:0] retain] autorelease]; from a secondary thread, the retain statement increments the retain count, but the autorelease only adds the object to the autorlease pool. Since the autorelease pool for a secondary thread isn't deallocated automatically, the objects listed don't get balancing release calls until the thread terminates or the autorelease pool is deallocated. From cmhofman at gmail.com Wed May 16 01:37:47 2007 From: cmhofman at gmail.com (Christiaan Hofman) Date: Wed May 16 01:37:58 2007 Subject: Follow-up questions on sample class ThreadSafeQueue In-Reply-To: <2BD43FAA-ED45-4683-B307-EF63BE905D9F@aol.com> References: <3E3436C3-B93D-4021-B936-806B44661C08@aol.com> <2BD43FAA-ED45-4683-B307-EF63BE905D9F@aol.com> Message-ID: On 16 May 2007, at 2:32 AM, Duncan Champney wrote: > > On May 15, 2007, at 7:37 PM, Shawn Erickson wrote: > >> On 5/15/07, Duncan Champney wrote: >>> Chris, >>> >>> Thanks for the link to the ThreadSafeQueue post. It makes good sense >>> to me to use NSConditionLock to manage shared access to a job queue. >>> >>> I have a couple of follow-up questions. >>> >>> I'm a little unclear on how the worker threads would use the >>> ThreadSafeQueue. I would think the ThreadSafeQueue object's methods >>> would run on the main thread, and the worker threads would call >>> those >>> methods using performSelectorOnMainThread. >> >> Why do you think that? The whole point of the class is to allow >> multiple threads to utilize the same queue directly. That is why it >> uses NSConditionLock to protect the data structure it manages. > > Shawn, > > Thanks for the reply. I'm still trying to wrap my head around the > subtleties of multi-threading. I understand you now. > >> >>> Also, I'm puzzled by a couple of lines in the method implementation. >>> Why do the methods in -dequeue and -tryDequeue retain and >>> autorelease >>> the object from "elements" in the same call. Here's the line from >>> tryDequeue: >>> >>> element = [[[elements objectAtIndex:0] retain] autorelease]; >> >> That retains the objects and balances that retain with an >> autorelease. >> That ensures that the object will continue to exist at least until >> sometime in the future when the current autorelease pool is released >> (drained). >> >> Why is this done? Well the removeObjectAtIndex: message could result >> in the "element" object being deallocated because the elements array >> could be the last object holding a retain on "element". >> >>> The retain and autorelease calls would seem to cancel each other >>> out. >> >> That is true but not immediately. >> >>> The retain call would increase the retain count for the object in >>> "elements", and then the autorelease would immediately decrement it, >>> for a net null effect. >> >> No autorelease doesn't immediately decrement the retain count. Review >> the concept of NSAutoreleasePools. > > I just did what you suggested and read the description of > NSAutoreleasePool VERY carefully. > > The point I didn't understand before was that only an app's main > thread automatically releases objects in the autorelease pool (when > deallocating the autoreleasePool on the next pass through the event > loop.) Secondary threads don't release objects in their autorelease > pools automatically - they have to deallocate their autorelease > pools explicitly in order for the objects in the pool to be > released. Here's the relevant text: > > > NSAutoreleasePool objects are automatically created and > destroyed in the main thread of applications based on the > Application Kit, so your code normally does not have to > > deal with them. The Application Kit creates a pool at the > beginning of the event loop and releases it at the end, thereby > periodically releasing any autoreleased objects > > generated while processing events. > > > Thus when you execute the example statement I gave before > > element = [[[elements objectAtIndex:0] retain] autorelease]; > > from a secondary thread, the retain statement increments the retain > count, but the autorelease only adds the object to the autorlease > pool. Since the autorelease pool for a secondary thread isn't > deallocated automatically, the objects listed don't get balancing > release calls until the thread terminates or the autorelease pool > is deallocated. > Yes, that's why you should always create/release an autorelease pool on any secondary thread you create. For example by running the runloop on the secondary thread like this: NSAutoReleasePool *pool = nil; BOOL didRun = YES; while (shouldKeepRunning && didRun) { [pool release]; pool = [[NSAutoReleasePool alloc] init]; didRun = [NSAutoreleasePool currentRunLoop] runMode:NSDefaultRunnLoopMode beforeDate:[NSDate distantFuture]; } [pool release]; Christiaan From Guenther.Fuerthaller at onevision.com Wed May 16 01:47:41 2007 From: Guenther.Fuerthaller at onevision.com (Guenther Fuerthaller) Date: Wed May 16 02:02:20 2007 Subject: Follow-up questions on sample class ThreadSafeQueue In-Reply-To: Message-ID: well you should avoid confusing him. runloops are for working with async streams. in his situation he would rather need: NSAutoReleasePool *pool = nil; BOOL didRun = YES; while (shouldKeepRunning && didRun) { [pool release]; pool = [[NSAutoReleasePool alloc] init]; element = [[[elements objectAtIndex:0] retain] autorelease]; // do something with your element and set didRun to NO if appropriate. } [pool release]; next question: why does it make sense to use autorelease/autoreleasepool rather than retain/release? guenther Christiaan Hofman Sent by: macosx-dev-bounces@omnigroup.com 16.05.2007 10:40 To MacOSX-Dev List , Duncan Champney cc Subject Re: Follow-up questions on sample class ThreadSafeQueue On 16 May 2007, at 2:32 AM, Duncan Champney wrote: > > On May 15, 2007, at 7:37 PM, Shawn Erickson wrote: > >> On 5/15/07, Duncan Champney wrote: >>> Chris, >>> >>> Thanks for the link to the ThreadSafeQueue post. It makes good sense >>> to me to use NSConditionLock to manage shared access to a job queue. >>> >>> I have a couple of follow-up questions. >>> >>> I'm a little unclear on how the worker threads would use the >>> ThreadSafeQueue. I would think the ThreadSafeQueue object's methods >>> would run on the main thread, and the worker threads would call >>> those >>> methods using performSelectorOnMainThread. >> >> Why do you think that? The whole point of the class is to allow >> multiple threads to utilize the same queue directly. That is why it >> uses NSConditionLock to protect the data structure it manages. > > Shawn, > > Thanks for the reply. I'm still trying to wrap my head around the > subtleties of multi-threading. I understand you now. > >> >>> Also, I'm puzzled by a couple of lines in the method implementation. >>> Why do the methods in -dequeue and -tryDequeue retain and >>> autorelease >>> the object from "elements" in the same call. Here's the line from >>> tryDequeue: >>> >>> element = [[[elements objectAtIndex:0] retain] autorelease]; >> >> That retains the objects and balances that retain with an >> autorelease. >> That ensures that the object will continue to exist at least until >> sometime in the future when the current autorelease pool is released >> (drained). >> >> Why is this done? Well the removeObjectAtIndex: message could result >> in the "element" object being deallocated because the elements array >> could be the last object holding a retain on "element". >> >>> The retain and autorelease calls would seem to cancel each other >>> out. >> >> That is true but not immediately. >> >>> The retain call would increase the retain count for the object in >>> "elements", and then the autorelease would immediately decrement it, >>> for a net null effect. >> >> No autorelease doesn't immediately decrement the retain count. Review >> the concept of NSAutoreleasePools. > > I just did what you suggested and read the description of > NSAutoreleasePool VERY carefully. > > The point I didn't understand before was that only an app's main > thread automatically releases objects in the autorelease pool (when > deallocating the autoreleasePool on the next pass through the event > loop.) Secondary threads don't release objects in their autorelease > pools automatically - they have to deallocate their autorelease > pools explicitly in order for the objects in the pool to be > released. Here's the relevant text: > > > NSAutoreleasePool objects are automatically created and > destroyed in the main thread of applications based on the > Application Kit, so your code normally does not have to > > deal with them. The Application Kit creates a pool at the > beginning of the event loop and releases it at the end, thereby > periodically releasing any autoreleased objects > > generated while processing events. > > > Thus when you execute the example statement I gave before > > element = [[[elements objectAtIndex:0] retain] autorelease]; > > from a secondary thread, the retain statement increments the retain > count, but the autorelease only adds the object to the autorlease > pool. Since the autorelease pool for a secondary thread isn't > deallocated automatically, the objects listed don't get balancing > release calls until the thread terminates or the autorelease pool > is deallocated. > Yes, that's why you should always create/release an autorelease pool on any secondary thread you create. For example by running the runloop on the secondary thread like this: NSAutoReleasePool *pool = nil; BOOL didRun = YES; while (shouldKeepRunning && didRun) { [pool release]; pool = [[NSAutoReleasePool alloc] init]; didRun = [NSAutoreleasePool currentRunLoop] runMode:NSDefaultRunnLoopMode beforeDate:[NSDate distantFuture]; } [pool release]; Christiaan _______________________________________________ MacOSX-dev mailing list MacOSX-dev@omnigroup.com http://www.omnigroup.com/mailman/listinfo/macosx-dev From cmhofman at gmail.com Wed May 16 02:13:32 2007 From: cmhofman at gmail.com (Christiaan Hofman) Date: Wed May 16 02:13:44 2007 Subject: Follow-up questions on sample class ThreadSafeQueue In-Reply-To: References: Message-ID: <1184B9DF-6FFA-4D4F-84DA-8FCE3F9CBAAF@gmail.com> On 16 May 2007, at 10:47 AM, Guenther Fuerthaller wrote: > > well you should avoid confusing him. > runloops are for working with async streams. > in his situation he would rather need: > > NSAutoReleasePool *pool = nil; > BOOL didRun = YES; > while (shouldKeepRunning && didRun) { > [pool release]; > pool = [[NSAutoReleasePool alloc] init]; > element = [[[elements objectAtIndex:0] retain] > autorelease]; > // do something with your element and set didRun to NO if appropriate. > } > [pool release]; > > next question: why does it make sense to use > autorelease/autoreleasepool rather than retain/release? > > guenther Because this is actually wrapped in a generic method inThreadSafeQueue. Your change should have been something like element = [queue dequeue];. The alternative would be to use a method that implicitly retains the element (and call it something like dequeueAndCopy) and let the thread that uses it be responsible for releasing it, but that's not what Cocoa usually does. Also the rest of the handling of the element could (implicitly) use autorelease, so you should have an autorelease pool around anyway. Christiaan > > Christiaan Hofman > Sent by: macosx-dev-bounces@omnigroup.com > 16.05.2007 10:40 > > To > MacOSX-Dev List , Duncan Champney > > cc > Subject > Re: Follow-up questions on sample class ThreadSafeQueue > > > > > > > On 16 May 2007, at 2:32 AM, Duncan Champney wrote: > > > > > On May 15, 2007, at 7:37 PM, Shawn Erickson wrote: > > > >> On 5/15/07, Duncan Champney wrote: > >>> Chris, > >>> > >>> Thanks for the link to the ThreadSafeQueue post. It makes good > sense > >>> to me to use NSConditionLock to manage shared access to a job > queue. > >>> > >>> I have a couple of follow-up questions. > >>> > >>> I'm a little unclear on how the worker threads would use the > >>> ThreadSafeQueue. I would think the ThreadSafeQueue object's > methods > >>> would run on the main thread, and the worker threads would call > >>> those > >>> methods using performSelectorOnMainThread. > >> > >> Why do you think that? The whole point of the class is to allow > >> multiple threads to utilize the same queue directly. That is why it > >> uses NSConditionLock to protect the data structure it manages. > > > > Shawn, > > > > Thanks for the reply. I'm still trying to wrap my head around the > > subtleties of multi-threading. I understand you now. > > > >> > >>> Also, I'm puzzled by a couple of lines in the method > implementation. > >>> Why do the methods in -dequeue and -tryDequeue retain and > >>> autorelease > >>> the object from "elements" in the same call. Here's the line from > >>> tryDequeue: > >>> > >>> element = [[[elements objectAtIndex:0] retain] > autorelease]; > >> > >> That retains the objects and balances that retain with an > >> autorelease. > >> That ensures that the object will continue to exist at least until > >> sometime in the future when the current autorelease pool is > released > >> (drained). > >> > >> Why is this done? Well the removeObjectAtIndex: message could > result > >> in the "element" object being deallocated because the elements > array > >> could be the last object holding a retain on "element". > >> > >>> The retain and autorelease calls would seem to cancel each other > >>> out. > >> > >> That is true but not immediately. > >> > >>> The retain call would increase the retain count for the object in > >>> "elements", and then the autorelease would immediately > decrement it, > >>> for a net null effect. > >> > >> No autorelease doesn't immediately decrement the retain count. > Review > >> the concept of NSAutoreleasePools. > > > > I just did what you suggested and read the description of > > NSAutoreleasePool VERY carefully. > > > > The point I didn't understand before was that only an app's main > > thread automatically releases objects in the autorelease pool (when > > deallocating the autoreleasePool on the next pass through the event > > loop.) Secondary threads don't release objects in their autorelease > > pools automatically - they have to deallocate their autorelease > > pools explicitly in order for the objects in the pool to be > > released. Here's the relevant text: > > > > > > NSAutoreleasePool objects are automatically created and > > destroyed in the main thread of applications based on the > > Application Kit, so your code normally does not have to > > > > deal with them. The Application Kit creates a pool at the > > beginning of the event loop and releases it at the end, thereby > > periodically releasing any autoreleased objects > > > > generated while processing events. > > > > > > Thus when you execute the example statement I gave before > > > > element = [[[elements objectAtIndex:0] retain] autorelease]; > > > > from a secondary thread, the retain statement increments the retain > > count, but the autorelease only adds the object to the autorlease > > pool. Since the autorelease pool for a secondary thread isn't > > deallocated automatically, the objects listed don't get balancing > > release calls until the thread terminates or the autorelease pool > > is deallocated. > > > > Yes, that's why you should always create/release an autorelease pool > on any secondary thread you create. For example by running the > runloop on the secondary thread like this: > > NSAutoReleasePool *pool = nil; > BOOL didRun = YES; > while (shouldKeepRunning && didRun) { > [pool release]; > pool = [[NSAutoReleasePool alloc] init]; > didRun = [NSAutoreleasePool currentRunLoop] > runMode:NSDefaultRunnLoopMode beforeDate:[NSDate distantFuture]; > } > [pool release]; > > Christiaan > > > _______________________________________________ > MacOSX-dev mailing list > MacOSX-dev@omnigroup.com > http://www.omnigroup.com/mailman/listinfo/macosx-dev > > From gweston at mac.com Thu May 17 13:15:56 2007 From: gweston at mac.com (Gregory Weston) Date: Thu May 17 13:16:02 2007 Subject: Remounting storage devices Message-ID: <9BDEB20D-0614-4D03-857C-8F7E5CA21B9D@mac.com> I've been looking through the docs, list archives and Google today without luck. I'm sure this means I'm not searching for the right terms. Let's say I plug a USB thumb drive into my machine and wait for it to mount and show up in Finder. Now a I select it and choose Eject from the File menu. It disappears. How do I get it back? I can still find it in the IO registry as a block storage device, but not as media (which makes sense) but is there any way for a program that I launch after ejecting the drive but before unplugging it to tell the OS to mount the volume(s) on it? From SParikh at affinegy.com Thu May 17 13:26:33 2007 From: SParikh at affinegy.com (Sandeep Parikh) Date: Thu May 17 13:38:49 2007 Subject: Remounting storage devices In-Reply-To: <9BDEB20D-0614-4D03-857C-8F7E5CA21B9D@mac.com> Message-ID: Gregory, Disk Utility still sees the device and can mount/unmount/remount the device. Perhaps the answer you are looking for is there... These might be good places to start as well... http://developer.apple.com/documentation/Darwin/Reference/DiscArbitrationFra mework/index.html http://developer.apple.com/reference/HardwareDrivers/idxMassStorageDevices-d ate.html -Sandeep > From: Gregory Weston > Date: Thu, 17 May 2007 16:15:56 -0400 > To: > Subject: Remounting storage devices > > I've been looking through the docs, list archives and Google today > without luck. I'm sure this means I'm not searching for the right terms. > > Let's say I plug a USB thumb drive into my machine and wait for it to > mount and show up in Finder. > Now a I select it and choose Eject from the File menu. It disappears. > > How do I get it back? > > I can still find it in the IO registry as a block storage device, but > not as media (which makes sense) but is there any way for a program > that I launch after ejecting the drive but before unplugging it to > tell the OS to mount the volume(s) on it? > > > _______________________________________________ > MacOSX-dev mailing list > MacOSX-dev@omnigroup.com > http://www.omnigroup.com/mailman/listinfo/macosx-dev From gweston at mac.com Thu May 17 14:53:50 2007 From: gweston at mac.com (Gregory Weston) Date: Thu May 17 14:53:58 2007 Subject: Remounting storage devices In-Reply-To: References: Message-ID: <315C23DC-5E4C-495A-AE68-951A94E611B9@mac.com> On May 17, 2007, at 4:26 PM, Sandeep Parikh wrote: > Gregory, > > Disk Utility still sees the device and can mount/unmount/remount > the device. > Perhaps the answer you are looking for is there... Actually, it's not showing the device to me on the left side list. Finder doesn't just unmount, it "ejects." The /dev entries disappear. G From kusterer at gmail.com Sat May 19 04:08:03 2007 From: kusterer at gmail.com (Uli Kusterer) Date: Sat May 19 04:08:32 2007 Subject: Follow-up questions on sample class ThreadSafeQueue In-Reply-To: References: Message-ID: <3184F020-7142-428D-BA07-92328BB3CE42@gmail.com> On 16.05.2007, at 10:47, Guenther Fuerthaller wrote: > next question: why does it make sense to use > autorelease/autoreleasepool rather than retain/release? This podcast may shed some light on the whole matter: http://latenightcocoa.com/node/57 Disclaimer: I was involved in that episode. Cheers, -- M. Uli Kusterer http://www.zathras.de From mattejames at gmail.com Wed May 23 19:01:51 2007 From: mattejames at gmail.com (Matthew James) Date: Wed May 23 19:01:55 2007 Subject: How much should a good 3D icon cost? Message-ID: <27cd4a440705231901j2a76e149va78559d0f7d1ea41@mail.gmail.com> I'm in the planning and design stage for my first Mac OS X application and have been thinking about the icon for my application. I know very well what I'm looking for, but am wondering what I should expect to be charged for a nice 3D icon. My expectations of the designer are to iterate through a few versions of the design until it's as I imagine and then to produce a model that can be manipulated as seen fit for an icon and marketing materials. I assume that a designer would charge first for the model and then for whatever subsequent manipulations of that model I require. Does anyone have any experience dealing with this sort of thing that they can share? Thanks! From mattejames at gmail.com Thu May 24 17:40:08 2007 From: mattejames at gmail.com (Matthew James) Date: Thu May 24 17:40:23 2007 Subject: Can we use Apple artwork? Message-ID: <27cd4a440705241740k40a649bft7495a484b71a711d@mail.gmail.com> Are we allowed to use Apple artwork in our apps? The application I'm designing makes heavy use of standard Apple icons, but the only place I've found full-quality versions is within the "Contents/Resources" directories of many of their apps like Preview, iTunes, iPhoto, Finder, etc. In order to include these icons in my app, is there a way to programmatically call them or do I have to include in the actual .app file. I feel as though the latter probably goes against some IP issue, so I'm hoping that the former is technically achievable. What about other graphics found in Apple's applications (outside of icons)? For instance, the graphics that drive their custom buttons, checkboxes, scrollbars, etc found in many of the iLife applications? Since these aren't directly available "for free" from Cocoa, I assume we have to re-make our own to be in-line with the new "standard" GUI (though I'm sure this will change a bit when Leopard is fully revealed next month). I also assume that using the exact images found within Apples apps would be asking for IP issues. In this case, how do indie Mac developers keep up with the latest Apple UI without getting into trouble? Is it all just Photoshop "best-you-can-get" duplication? Thanks for any thoughts on the subject! -Matt James From tjones at acworld.com Thu May 24 21:03:05 2007 From: tjones at acworld.com (Tom Jones) Date: Thu May 24 21:23:53 2007 Subject: Bounce the icon in the dock.. Message-ID: Hello, I've been playing around with trying to get the icon in the dock to bounce with no luck. I'm trying [NSApp requestUserAttention:NSInformationalRequest]; But I've had no luck with it. Any suggestions? Thanks, tom From rob at menumachine.com Fri May 25 00:50:31 2007 From: rob at menumachine.com (Rob Keniger) Date: Fri May 25 00:50:59 2007 Subject: Bounce the icon in the dock.. In-Reply-To: References: Message-ID: On 25/05/2007, at 2:03 PM, Tom Jones wrote: > I've been playing around with trying to get the icon in the dock to > bounce > with no luck. I'm trying > [NSApp requestUserAttention:NSInformationalRequest]; > > But I've had no luck with it. What are you trying to achieve? A bouncing icon in the Dock has very specific and well understood meaning to users. [NSApp requestUserAttention:] will bounce the app icon only if the application is not active. I don't think there's a way to bounce the icon if your application is the frontmost app. This is by design as the bouncing icon is designed to notify you that a background application needs your attention. -- Rob Keniger From cmhofman at gmail.com Fri May 25 04:09:26 2007 From: cmhofman at gmail.com (Christiaan Hofman) Date: Fri May 25 04:09:34 2007 Subject: Can we use Apple artwork? In-Reply-To: <27cd4a440705241740k40a649bft7495a484b71a711d@mail.gmail.com> References: <27cd4a440705241740k40a649bft7495a484b71a711d@mail.gmail.com> Message-ID: <76B1BA0F-0126-4A5E-9D41-6A33053E1807@gmail.com> Some icons are programmatically available using Icon Services (search the Carbon docs). The other artwork is copyrighted by Apple. Some artwork is freely available after registering using a form (mostly artwork associated to certain Apple technology, such as Bonjour and MacUniversal). As for the rest, like icons from Apple bundles, legally you're not allowed to use them. But there are a lot of 3rd party apps that use them, and AFAIK Apple doesn't take action (though perhaps for commercial apps they do?). I guess that it is in particular OK to use for artwork that is becoming standard and probably will make it into Cocoa in the next version. So it's on your own risk. I am actually also curious what Apple's official and non-official position is on this. Christiaan On 25 May 2007, at 2:40 AM, Matthew James wrote: > Are we allowed to use Apple artwork in our apps? The application I'm > designing makes heavy use of standard Apple icons, but the only place > I've found full-quality versions is within the "Contents/Resources" > directories of many of their apps like Preview, iTunes, iPhoto, > Finder, etc. > > In order to include these icons in my app, is there a way to > programmatically call them or do I have to include in the actual .app > file. I feel as though the latter probably goes against some IP > issue, so I'm hoping that the former is technically achievable. > > What about other graphics found in Apple's applications (outside of > icons)? For instance, the graphics that drive their custom buttons, > checkboxes, scrollbars, etc found in many of the iLife applications? > Since these aren't directly available "for free" from Cocoa, I assume > we have to re-make our own to be in-line with the new "standard" GUI > (though I'm sure this will change a bit when Leopard is fully revealed > next month). I also assume that using the exact images found within > Apples apps would be asking for IP issues. In this case, how do indie > Mac developers keep up with the latest Apple UI without getting into > trouble? Is it all just Photoshop "best-you-can-get" duplication? > > Thanks for any thoughts on the subject! > > -Matt James > _______________________________________________ > MacOSX-dev mailing list > MacOSX-dev@omnigroup.com > http://www.omnigroup.com/mailman/listinfo/macosx-dev From ronaldoussoren at mac.com Fri May 25 04:28:58 2007 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Fri May 25 04:29:03 2007 Subject: Can we use Apple artwork? In-Reply-To: <76B1BA0F-0126-4A5E-9D41-6A33053E1807@gmail.com> References: <27cd4a440705241740k40a649bft7495a484b71a711d@mail.gmail.com> <76B1BA0F-0126-4A5E-9D41-6A33053E1807@gmail.com> Message-ID: <2CB3D8B9-0112-1000-A6B7-2D28C5213B40-Webmail-10016@mac.com> On Friday, May 25, 2007, at 01:09PM, "Christiaan Hofman" wrote: >Some icons are programmatically available using Icon Services (search >the Carbon docs). The other artwork is copyrighted by Apple. Some >artwork is freely available after registering using a form (mostly >artwork associated to certain Apple technology, such as Bonjour and >MacUniversal). > >As for the rest, like icons from Apple bundles, legally you're not >allowed to use them. But there are a lot of 3rd party apps that use >them, and AFAIK Apple doesn't take action (though perhaps for >commercial apps they do?). I guess that it is in particular OK to use >for artwork that is becoming standard and probably will make it into >Cocoa in the next version. So it's on your own risk. I am actually >also curious what Apple's official and non-official position is on this. It might not be necessary to embed the artwork anyway. If you want to use icons for file-types you can load these at runtime using NSWorkspace -iconForFileType: and I'm pretty sure there's also an API for loading application icons. Ronald > >Christiaan > >On 25 May 2007, at 2:40 AM, Matthew James wrote: > >> Are we allowed to use Apple artwork in our apps? The application I'm >> designing makes heavy use of standard Apple icons, but the only place >> I've found full-quality versions is within the "Contents/Resources" >> directories of many of their apps like Preview, iTunes, iPhoto, >> Finder, etc. >> >> In order to include these icons in my app, is there a way to >> programmatically call them or do I have to include in the actual .app >> file. I feel as though the latter probably goes against some IP >> issue, so I'm hoping that the former is technically achievable. >> >> What about other graphics found in Apple's applications (outside of >> icons)? For instance, the graphics that drive their custom buttons, >> checkboxes, scrollbars, etc found in many of the iLife applications? >> Since these aren't directly available "for free" from Cocoa, I assume >> we have to re-make our own to be in-line with the new "standard" GUI >> (though I'm sure this will change a bit when Leopard is fully revealed >> next month). I also assume that using the exact images found within >> Apples apps would be asking for IP issues. In this case, how do indie >> Mac developers keep up with the latest Apple UI without getting into >> trouble? Is it all just Photoshop "best-you-can-get" duplication? >> >> Thanks for any thoughts on the subject! >> >> -Matt James >> _______________________________________________ >> MacOSX-dev mailing list >> MacOSX-dev@omnigroup.com >> http://www.omnigroup.com/mailman/listinfo/macosx-dev > >_______________________________________________ >MacOSX-dev mailing list >MacOSX-dev@omnigroup.com >http://www.omnigroup.com/mailman/listinfo/macosx-dev > > From mattejames at gmail.com Fri May 25 04:51:28 2007 From: mattejames at gmail.com (Matthew James) Date: Fri May 25 04:51:32 2007 Subject: Can we use Apple artwork? In-Reply-To: <76B1BA0F-0126-4A5E-9D41-6A33053E1807@gmail.com> References: <27cd4a440705241740k40a649bft7495a484b71a711d@mail.gmail.com> <76B1BA0F-0126-4A5E-9D41-6A33053E1807@gmail.com> Message-ID: <27cd4a440705250451v5c882d98y1a04191ddf9710dd@mail.gmail.com> Thanks for the tips! This icons are the real concern; I can make my own UI pretty easily, but replicating the iPhoto icon, for instance, would either a) never come out exactly right and would make my users cringe everytime they saw it or b) look so much like it that I am on unsteady ground. Thanks! -Matt James On 5/25/07, Christiaan Hofman wrote: > Some icons are programmatically available using Icon Services (search > the Carbon docs). The other artwork is copyrighted by Apple. Some > artwork is freely available after registering using a form (mostly > artwork associated to certain Apple technology, such as Bonjour and > MacUniversal). > > As for the rest, like icons from Apple bundles, legally you're not > allowed to use them. But there are a lot of 3rd party apps that use > them, and AFAIK Apple doesn't take action (though perhaps for > commercial apps they do?). I guess that it is in particular OK to use > for artwork that is becoming standard and probably will make it into > Cocoa in the next version. So it's on your own risk. I am actually > also curious what Apple's official and non-official position is on this. > > Christiaan > > On 25 May 2007, at 2:40 AM, Matthew James wrote: > > > Are we allowed to use Apple artwork in our apps? The application I'm > > designing makes heavy use of standard Apple icons, but the only place > > I've found full-quality versions is within the "Contents/Resources" > > directories of many of their apps like Preview, iTunes, iPhoto, > > Finder, etc. > > > > In order to include these icons in my app, is there a way to > > programmatically call them or do I have to include in the actual .app > > file. I feel as though the latter probably goes against some IP > > issue, so I'm hoping that the former is technically achievable. > > > > What about other graphics found in Apple's applications (outside of > > icons)? For instance, the graphics that drive their custom buttons, > > checkboxes, scrollbars, etc found in many of the iLife applications? > > Since these aren't directly available "for free" from Cocoa, I assume > > we have to re-make our own to be in-line with the new "standard" GUI > > (though I'm sure this will change a bit when Leopard is fully revealed > > next month). I also assume that using the exact images found within > > Apples apps would be asking for IP issues. In this case, how do indie > > Mac developers keep up with the latest Apple UI without getting into > > trouble? Is it all just Photoshop "best-you-can-get" duplication? > > > > Thanks for any thoughts on the subject! > > > > -Matt James > > _______________________________________________ > > MacOSX-dev mailing list > > MacOSX-dev@omnigroup.com > > http://www.omnigroup.com/mailman/listinfo/macosx-dev > > From mattejames at gmail.com Fri May 25 04:52:03 2007 From: mattejames at gmail.com (Matthew James) Date: Fri May 25 04:52:06 2007 Subject: Can we use Apple artwork? In-Reply-To: <2CB3D8B9-0112-1000-A6B7-2D28C5213B40-Webmail-10016@mac.com> References: <27cd4a440705241740k40a649bft7495a484b71a711d@mail.gmail.com> <76B1BA0F-0126-4A5E-9D41-6A33053E1807@gmail.com> <2CB3D8B9-0112-1000-A6B7-2D28C5213B40-Webmail-10016@mac.com> Message-ID: <27cd4a440705250452r6f853085lf12c2388e4a781ea@mail.gmail.com> Excellent! I thought there must be some way to do this in Cocoa, but I'm only in the design stage of the application and have no background in the inner-workings of OS X development (yet). Thanks so much for pointing me to this! -Matt On 5/25/07, Ronald Oussoren wrote: > > On Friday, May 25, 2007, at 01:09PM, "Christiaan Hofman" wrote: > >Some icons are programmatically available using Icon Services (search > >the Carbon docs). The other artwork is copyrighted by Apple. Some > >artwork is freely available after registering using a form (mostly > >artwork associated to certain Apple technology, such as Bonjour and > >MacUniversal). > > > >As for the rest, like icons from Apple bundles, legally you're not > >allowed to use them. But there are a lot of 3rd party apps that use > >them, and AFAIK Apple doesn't take action (though perhaps for > >commercial apps they do?). I guess that it is in particular OK to use > >for artwork that is becoming standard and probably will make it into > >Cocoa in the next version. So it's on your own risk. I am actually > >also curious what Apple's official and non-official position is on this. > > It might not be necessary to embed the artwork anyway. If you want to use icons for file-types you can load these at runtime using NSWorkspace -iconForFileType: and I'm pretty sure there's also an API for loading application icons. > > Ronald > > > > >Christiaan > > > >On 25 May 2007, at 2:40 AM, Matthew James wrote: > > > >> Are we allowed to use Apple artwork in our apps? The application I'm > >> designing makes heavy use of standard Apple icons, but the only place > >> I've found full-quality versions is within the "Contents/Resources" > >> directories of many of their apps like Preview, iTunes, iPhoto, > >> Finder, etc. > >> > >> In order to include these icons in my app, is there a way to > >> programmatically call them or do I have to include in the actual .app > >> file. I feel as though the latter probably goes against some IP > >> issue, so I'm hoping that the former is technically achievable. > >> > >> What about other graphics found in Apple's applications (outside of > >> icons)? For instance, the graphics that drive their custom buttons, > >> checkboxes, scrollbars, etc found in many of the iLife applications? > >> Since these aren't directly available "for free" from Cocoa, I assume > >> we have to re-make our own to be in-line with the new "standard" GUI > >> (though I'm sure this will change a bit when Leopard is fully revealed > >> next month). I also assume that using the exact images found within > >> Apples apps would be asking for IP issues. In this case, how do indie > >> Mac developers keep up with the latest Apple UI without getting into > >> trouble? Is it all just Photoshop "best-you-can-get" duplication? > >> > >> Thanks for any thoughts on the subject! > >> > >> -Matt James > >> _______________________________________________ > >> MacOSX-dev mailing list > >> MacOSX-dev@omnigroup.com > >> http://www.omnigroup.com/mailman/listinfo/macosx-dev > > > >_______________________________________________ > >MacOSX-dev mailing list > >MacOSX-dev@omnigroup.com > >http://www.omnigroup.com/mailman/listinfo/macosx-dev > > > > > _______________________________________________ > MacOSX-dev mailing list > MacOSX-dev@omnigroup.com > http://www.omnigroup.com/mailman/listinfo/macosx-dev > From heizer1 at llnl.gov Fri May 25 15:45:35 2007 From: heizer1 at llnl.gov (Charles E. Heizer1) Date: Fri May 25 15:45:45 2007 Subject: Force my application to be the front most app... Message-ID: Hello, Can someone point me in the right direction please. I would like to force my application to be the front most application. I know, this is not good practice, but my app is a Nag-ware app and in-house only. Any examples or anything would be great! Thanks, -- Charles ------------------------------------------------------------------------ Charles Heizer Systems Management Solutions Group Lawrence Livermore National Laboratory 7000 East Ave. L-285 Livermore, CA 94550 Phone: (925)422-0197 Fax:(925)422-2425 email: heizer1@llnl.gov ------------------------------------------------------------------------ From macosxdevlist at personal.fishh2o.com Fri May 25 15:53:55 2007 From: macosxdevlist at personal.fishh2o.com (SD) Date: Fri May 25 15:54:12 2007 Subject: Force my application to be the front most app... In-Reply-To: References: Message-ID: NSApplication - (void)activateIgnoringOtherApps:(BOOL)flag http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSApplication_Class/index.html#//apple_ref/doc/uid/TP40004004 SD ______________________________________________________________________ Previous message on 5/25/07 at 3:45 PM -0700 ********************************************************************** >Hello, >Can someone point me in the right direction please. I would like to force my >application to be the front most application. I know, this is not good >practice, but my app is a Nag-ware app and in-house only. > >Any examples or anything would be great! > >Thanks, > -- Charles -- ========================================== SD WARNING: Programming may be habit forming. From daniel at highdesertchurch.com Fri May 25 15:57:37 2007 From: daniel at highdesertchurch.com (Daniel Hazelbaker) Date: Fri May 25 15:58:32 2007 Subject: Force my application to be the front most app... In-Reply-To: References: Message-ID: <1D33B609-C779-4571-99E8-9E45DCA91021@highdesertchurch.com> ProcessSerialNumber myPSN; GetCurrentProcess(&myPSN); SetFrontProcess(&myPSN); I use a technique like this to do the opposite of you. I use this type of code to force my application into the background after the user acknowledges something. Depending on your specific needs the method posted by SD might work better. Daniel On May 25, 2007, at 3:45 PM, Charles E. Heizer1 wrote: > Hello, > Can someone point me in the right direction please. I would like to > force my > application to be the front most application. I know, this is not good > practice, but my app is a Nag-ware app and in-house only. > > Any examples or anything would be great! > > Thanks, > -- Charles > > ---------------------------------------------------------------------- > -- > Charles Heizer > Systems Management Solutions Group > Lawrence Livermore National Laboratory > 7000 East Ave. > L-285 > Livermore, CA 94550 > Phone: (925)422-0197 > Fax:(925)422-2425 > email: heizer1@llnl.gov > ---------------------------------------------------------------------- > -- > > > > > _______________________________________________ > MacOSX-dev mailing list > MacOSX-dev@omnigroup.com > http://www.omnigroup.com/mailman/listinfo/macosx-dev > From edenwaith at mac.com Fri May 25 16:06:47 2007 From: edenwaith at mac.com (Chad Armstrong) Date: Fri May 25 16:06:53 2007 Subject: Can we use Apple artwork? In-Reply-To: <20070525190006.C4AD517D824@forums.omnigroup.com> References: <20070525190006.C4AD517D824@forums.omnigroup.com> Message-ID: I would say that Christiaan nailed it. I've heard that you are "officially" not supposed to use Apple's icons, but I think that is a grey area on what is acceptable and what is not. The printer icon is pretty standard and comes automatic in a Toolbar. There are also a variety of other icons which are fairly standard (delete, zoom in/out, etc.). Plus there are even a couple custom buttons that Apple uses (back/forward, +/-). I would think that those could be fair game. If not, you'll need to recreate them. For one app I'm writing, I've done a fair bit of custom icon development, but pretty much followed after how Apple has created its own icons and buttons. Regards, Chad Armstrong On May 25, 2007, at 2:00 PM, macosx-dev-request@omnigroup.com wrote: > Are we allowed to use Apple artwork in our apps? The application I'm > designing makes heavy use of standard Apple icons, but the only place > I've found full-quality versions is within the "Contents/Resources" > directories of many of their apps like Preview, iTunes, iPhoto, > Finder, etc. > > In order to include these icons in my app, is there a way to > programmatically call them or do I have to include in the actual .app > file. I feel as though the latter probably goes against some IP > issue, so I'm hoping that the former is technically achievable. > > What about other graphics found in Apple's applications (outside of > icons)? For instance, the graphics that drive their custom buttons, > checkboxes, scrollbars, etc found in many of the iLife applications? > Since these aren't directly available "for free" from Cocoa, I assume > we have to re-make our own to be in-line with the new "standard" GUI > (though I'm sure this will change a bit when Leopard is fully revealed > next month). I also assume that using the exact images found within > Apples apps would be asking for IP issues. In this case, how do indie > Mac developers keep up with the latest Apple UI without getting into > trouble? Is it all just Photoshop "best-you-can-get" duplication? > > Thanks for any thoughts on the subject! > > -Matt James From macosxdevlist at personal.fishh2o.com Fri May 25 18:51:51 2007 From: macosxdevlist at personal.fishh2o.com (SD) Date: Fri May 25 18:56:22 2007 Subject: Force my application to be the front most app... Message-ID: Also to note, Daniel's version is Carbon, mine is Cocoa, depends which technology you are using/have access to. Thanx for that code Daniel. SD. ______________________________________________________________________ Previous message on 5/25/07 at 3:57 PM -0700 ********************************************************************** >ProcessSerialNumber myPSN; > >GetCurrentProcess(&myPSN); >SetFrontProcess(&myPSN); > >I use a technique like this to do the opposite of you. I use this >type of code to force my application into the background after the >user acknowledges something. Depending on your specific needs the >method posted by SD might work better. > >Daniel > >On May 25, 2007, at 3:45 PM, Charles E. Heizer1 wrote: > >>Hello, >>Can someone point me in the right direction please. I would like to force my >>application to be the front most application. I know, this is not good >>practice, but my app is a Nag-ware app and in-house only. >> >>Any examples or anything would be great! >> >>Thanks, >> -- Charles -- --------------------------------------------- http://www.FishH2O.com Please see my website for more aquatic items and free software. -- ========================================== SD WARNING: Programming may be habit forming. From kenny_leung at pobox.com Fri May 25 19:28:33 2007 From: kenny_leung at pobox.com (Kenny Leung) Date: Fri May 25 19:28:43 2007 Subject: Problems using Sparkle Message-ID: Hi All. I am trying to use the Sparkle framework to auto-update our app, but am running into some problems. There seems to be a large user base for Sparkle, so I find it hard to believe that there is a bug as simple as this. No matter what version is in the RSS feed, Sparkle always wants to pop up the update panel, even when it knows that the app is up to date. (I know because it's calling the delegate method that reports that it doesn't have a new version.) Has anyone run into a similar situation? Thanks! -Kenny From dunham at mac.com Fri May 25 20:16:31 2007 From: dunham at mac.com (David Dunham) Date: Fri May 25 20:16:40 2007 Subject: Problems using Sparkle In-Reply-To: References: Message-ID: On 25 May 2007, at 19:28, Kenny Leung wrote: > No matter what version is in the RSS feed, Sparkle always wants to > pop up the update panel, even when it knows that the app is up to > date. (I know because it's calling the delegate method that reports > that it doesn't have a new version.) That's odd. I did experience problems because Sparkle's idea of a version number wasn't the same as mine -- I had to change my plist to CFBundleVersion = "53"; /* Sparkle wants us to have this; treat as build number */ CFBundleShortVersionString = "1.0.8"; instead of using CFBundleVersion as a date the way I wanted. David Dunham A Sharp, LLC Voice/Fax: 206 783 7404 http://a-sharp.com Efficiency is intelligent laziness. From gweston at mac.com Sat May 26 13:36:49 2007 From: gweston at mac.com (Gregory Weston) Date: Sat May 26 13:36:56 2007 Subject: Force my application to be the front most app... In-Reply-To: <20070526190004.86B3E17E2D2@forums.omnigroup.com> References: <20070526190004.86B3E17E2D2@forums.omnigroup.com> Message-ID: <7FDBECD6-8EA3-4B4C-B31E-E7CF561CE41E@mac.com> heizer1@llnl.gov wrote: > Hello, > Can someone point me in the right direction please. I would like to > force my > application to be the front most application. I know, this is not good > practice, but my app is a Nag-ware app and in-house only. Aside from the Cocoa and Carbon techniques people have shown you to actually bring yourself the front, another alternative is bit of the API called the notification manager. The real point of it is to get the user's attention in a way that's not potentially destructive to either the active app or the one requesting attention. It might be appropriate for your needs. Greg From dev-lists at arizona-software.ch Sun May 27 10:07:00 2007 From: dev-lists at arizona-software.ch (Simon Bovet) Date: Sun May 27 11:07:35 2007 Subject: Localization software In-Reply-To: <1031A86F-F403-46FE-85FF-BE1512FC6447@alwancolor.com> References: <1031A86F-F403-46FE-85FF-BE1512FC6447@alwancolor.com> Message-ID: You might also want to have a look at iLocalize: http://www.arizona-software.ch/ilocalize Cheers, Simon On 4 mai 07, at 18:10, Florent Lacheroy wrote: > Hi, > > I'm currently looking for localization tools. I've already tested > Apple recommended tools (AppleGlot, AppleTrans...) and Localization > Suite 2.0 from The Blue Technologies Group. > The last one looks great for me as the localization files sent to > localizers embed a preview of the interface and it's easy to use. > > I wonder if anyone has already tested this software in depth and > use it for a while? > I'm also open to any other solution for localization and looking > for any advice about this subject. > > I almost forget to say that my application is developed in > Objective-C using Cocoa framework (this may be of importance :) ). > > > Thanks, > > > Florent. > > Alwan Color Expertise > http://www.alwancolor.com/ > > > _______________________________________________ > MacOSX-dev mailing list > MacOSX-dev@omnigroup.com > http://www.omnigroup.com/mailman/listinfo/macosx-dev From fabianschuiki at bluewin.ch Sun May 27 12:02:36 2007 From: fabianschuiki at bluewin.ch (Fabian Schuiki) Date: Sun May 27 12:02:50 2007 Subject: Localization software In-Reply-To: References: <1031A86F-F403-46FE-85FF-BE1512FC6447@alwancolor.com> Message-ID: <23665382-CF5E-43BB-B413-769771E44384@bluewin.ch> Hi, I've been usign blue-tec's sol