Charles Heizer | 3 May 2007 03:33

Best way to reboot a system...

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@...
------------------------------------------------------------------------
Tobias Peciva | 3 May 2007 03:43
Picon

Re: Best way to reboot a system...

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
Charles Heizer | 3 May 2007 05:51

applicationDidFinishLaunching problems

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( <at> "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@...
------------------------------------------------------------------------
SD | 3 May 2007 05:55

Re: applicationDidFinishLaunching problems

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( <at> "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
(Continue reading)

Charles Heizer | 3 May 2007 06:08

Re: applicationDidFinishLaunching problems

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( <at> "Hello World");
>>
>> }
>>
>> Any help would be great,
>>
>> Thanks,
>> - Charles
>>
>> --------------------------------------------------------------------- 
(Continue reading)

Charles Heizer | 3 May 2007 20:16

NSPopupButton Question

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: <at> "5 Minutes",  
 <at> "10 Minutes",  <at> "15 Minutes",  <at> "30 Minutes",  <at> "1 hour",  <at> "2 hours",  
 <at> "Never",  <at> "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@...
------------------------------------------------------------------------
Charles Heizer | 3 May 2007 20:24

Re: NSPopupButton Question

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: <at> "5  
> Minutes",  <at> "10 Minutes",  <at> "15 Minutes",  <at> "30 Minutes",  <at> "1 hour",  
>  <at> "2 hours",  <at> "Never",  <at> "1 Minute", nil]];
>
>
> I hope this make sense,
> Thanks,
> - Charles
>
>
> ---------------------------------------------------------------------- 
> --
> Charles Heizer
> Systems Management Solutions Group
(Continue reading)

János | 3 May 2007 20:50
Picon
Favicon

libjpeg

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  
(Continue reading)

Graham J Lee | 3 May 2007 20:58

Re: libjpeg

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:
> <snip>
> 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 <filename>] [-seg_addr_table_filename  
> <file_system_path>] [-all_load] [-noall_load]
> make: *** [jcapimin.lo] Error 1
> </snip>
>
> 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
...
(Continue reading)

Koryn Grant | 3 May 2007 21:47
Picon

Re: libjpeg

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
(Continue reading)


Gmane