 |
 |
Changing DT w/o Carbon
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: May 2002
Location: Ft Lauderdale
Status:
Offline
|
|
I am looking for a simple way to change the desktop image with cocoa. Right now I have my code set-up to change the image in com.apple.desktop.plist. Now I need the desktop to be set...I found this <a href="http://developer.apple.com/samplecode/Sample_Code/Cocoa/DeskPictAppDockMenu.htm" target="_blank">http://developer.apple.com/samplecode/Sample_Code/Cocoa/DeskPictAppDockMenu.htm</a>, but its pretty complex and I dont want to use carbon calls if I don't have to. Is this possible?
|
|
|
| |
|
|
|
 |
|
 |
|
Grizzled Veteran
Join Date: Feb 2001
Location: Germany
Status:
Offline
|
|
sure, use an nstask to do something like "osascript -e 'tell application "Finder" to set the desktop picture to "Frunse:Users:seb  ictures:Hirn.tif"'" -- i left the path in there to show that you need to use colon separate paths. -- i actually once wrote a small app for myself that does nothing but periodically change the desktop background and this is exactly what i did.
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: May 2002
Location: Ft Lauderdale
Status:
Offline
|
|
Thanks, Look!
<img src="http://idisk.mac.com/vasudeva1/Public/statusMenu.jpg" alt=" - " />
go away non-image
|
|
|
| |
|
|
|
 |
|
 |
|
Grizzled Veteran
Join Date: Feb 2001
Location: Germany
Status:
Offline
|
|
haha, how funny. -- have a look:
<img src="http://homepage.mac.com/qe2/.Pictures/dt2.jpg" alt=" - " />
in "my" preferences is where you could set the desktop to rotate at a certain interval.
about the non-image, well, simply filter out everything beginning with ".", that way you're on the safe side as far as .fbc files and other stuff is concerned, as well.
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: May 2002
Location: Ft Lauderdale
Status:
Offline
|
|
Very cool. Its such a good idea, I think I originally got the idea from you. I was reading an old post on NSStatusItem's.
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Enthusiast
Join Date: Jul 2000
Location: Dubai, UAE
Status:
Offline
|
|
Where can I find sample code to add a new menu to the right side of the menu bar in X?
I'd like a program that sits in the menu bar and runs mostly as a background task, but has a set of prefs that can be adjusted via a menu such as those above.
Thanks,
Trygve
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Enthusiast
Join Date: Nov 2001
Status:
Offline
|
|
<strong> </font><blockquote><font size="1" face="Geneva, Verdana, Arial, sans-serif">quote:</font><hr /><font size="1" face="Geneva, Verdana, Arial, sans-serif">Originally posted by Trygve:
[qb]Where can I find sample code to add a new menu to the right side of the menu bar in X?
I'd like a program that sits in the menu bar and runs mostly as a background task, but has a set of prefs that can be adjusted via a menu such as those above.
Thanks,
Trygve</strong></font><hr /></blockquote><font size="1" face="Geneva, Verdana, Arial, sans-serif">Have a look at <a href="http://developer.apple.com/techpubs/macosx/Cocoa/Reference/ApplicationKit/ObjC_classic/Classes/NSStatusItem.html," target="_blank">http://developer.apple.com/techpubs/macosx/Cocoa/Reference/ApplicationKit/ObjC_classic/Classes/NSStatusItem.html,</a> <a href="http://developer.apple.com/techpubs/macosx/Cocoa/Reference/ApplicationKit/ObjC_classic/Classes/NSStatusBar.html" target="_blank">http://developer.apple.com/techpubs/macosx/Cocoa/Reference/ApplicationKit/ObjC_classic/Classes/NSStatusBar.html</a> and <a href="http://developer.apple.com/techpubs/macosx/Cocoa/TasksAndConcepts/ProgrammingTopics/StatusBar/index.html." target="_blank">http://developer.apple.com/techpubs/macosx/Cocoa/TasksAndConcepts/ProgrammingTopics/StatusBar/index.html.</a> It's really easy; just do something like this:
</font><blockquote><font size="1" face="Geneva, Verdana, Arial, sans-serif">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">NSStatusBar *bar;
NSStatusItem *item;
bar = [NSStatusBar systemStatusBar];
item = [bar statusItemWithLength:NSSquareStatusItemLength];
[item retain];
[item setHighlightMode:YES];
[item setMenu:someMenu];
[item setImage:[NSImage imageNamed:@"PrettyImage"]];</pre><hr /></blockquote><font size="1" face="Geneva, Verdana, Arial, sans-serif">Good luck  .
<small>[ 07-08-2002, 02:54 AM: Message edited by: Ibson ]</small>
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|