Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Making Docklings

Making Docklings
Thread Tools
Posting Junkie
Join Date: Jun 2001
Location: Washington DC
Status: Offline
Reply With Quote
Nov 9, 2001, 04:05 PM
 
Ok, I wrote a little java program that I want to turn into a dockling. All it needs to do is run a single method when i click it then display the text that comes out in a menu. How would I do this, or where should I look to find out?
     
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
Nov 9, 2001, 05:59 PM
 
You cannot write docklings in Java. The API is only available in C. Java is too much bloat and overhead with its evil VM to be loaded into the DocklingServer (or SystemUIServer or whatever it's called in 10.1).
     
Grizzled Veteran
Join Date: Feb 2001
Location: Germany
Status: Offline
Reply With Quote
Nov 9, 2001, 06:47 PM
 
would a java application be ok? they do support dock menus.
ok, it wouldn't be very elegant to always have a (windowless) app in the background, but it would work...
but have a look at obj-c, it's real fun to use.
     
Fresh-Faced Recruit
Join Date: Jan 2001
Location: Areas 51 thru 55 :P
Status: Offline
Reply With Quote
Nov 9, 2001, 06:49 PM
 
Originally posted by nonhuman:
<STRONG>Ok, I wrote a little java program that I want to turn into a dockling. All it needs to do is run a single method when i click it then display the text that comes out in a menu. How would I do this, or where should I look to find out?</STRONG>
Note: I do not know if this works in Java, but you can add your own content to the Dock Menu of your running application by becoming an NSApplication delegate. In Obj-C this would look like:

- (NSMenu *)applicationDockMenu NSApplication *)sender {
NSMenu* dockMenu = [[NSMenu alloc] init];
[dockMenu addItem:[favorites menuItem]];
return dockMenu;
}

Then set your app to run hidden at login (although I don't think I'd want to wait for the JVM to load at login).
Well, let's just say, 'if your VCR is still blinking 12:00,you don't want Linux'
     
Posting Junkie
Join Date: Jun 2001
Location: Washington DC
Status: Offline
Reply With Quote
Nov 9, 2001, 07:12 PM
 
Originally posted by seb2:
<STRONG>would a java application be ok? they do support dock menus.
ok, it wouldn't be very elegant to always have a (windowless) app in the background, but it would work...
but have a look at obj-c, it's real fun to use.</STRONG>
A dock menu for it as an application would work fine. How would I go about doing that?
     
Professional Poster
Join Date: Dec 2000
Location: Chicago, Illinois
Status: Offline
Reply With Quote
Nov 9, 2001, 07:39 PM
 
Originally posted by nonhuman:
<STRONG>

A dock menu for it as an application would work fine. How would I go about doing that?</STRONG>
It's actually really easy. The way I did it was subclass NSMenu and attatched it to the dockMenu outlet in your NSApplication instance (usually called File Ownder) in Interface Builder. Then the rest is the same as dealing with the NSMenu in the apple menu bar.

HTH,
F-bacher
     
Posting Junkie
Join Date: Jun 2001
Location: Washington DC
Status: Offline
Reply With Quote
Nov 9, 2001, 09:12 PM
 
Ok, at the risk of sounding very newbieish, how do I get to my java classes through Interface Builder? I just can't seem to figure it out.
     
Professional Poster
Join Date: Dec 2000
Location: Chicago, Illinois
Status: Offline
Reply With Quote
Nov 9, 2001, 10:39 PM
 
Okay, I thought it would be easier to explain with picturers. Go here: http://www.students.uiuc.edu/~fahrenba/tut/help.html

Any more questions, just post.
F-bacher
     
Posting Junkie
Join Date: Jun 2001
Location: Washington DC
Status: Offline
Reply With Quote
Nov 9, 2001, 10:42 PM
 
Thanks a bunch. Hopefully this should do it.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 09:50 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2