comparison mac/dw.m @ 1220:67ff39b9577c

Initial implementation of dw_taskbar_* for the Mac. Also added code in the test program to test.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Mon, 10 Oct 2011 00:40:22 +0000
parents dc8ea09605f7
children aac69b11e821
comparison
equal deleted inserted replaced
1219:771440316206 1220:67ff39b9577c
6074 * icon: Icon handle to display in the taskbar. 6074 * icon: Icon handle to display in the taskbar.
6075 * bubbletext: Text to show when the mouse is above the icon. 6075 * bubbletext: Text to show when the mouse is above the icon.
6076 */ 6076 */
6077 void API dw_taskbar_insert(HWND handle, HICN icon, char *bubbletext) 6077 void API dw_taskbar_insert(HWND handle, HICN icon, char *bubbletext)
6078 { 6078 {
6079 NSLog(@"dw_taskbar_insert() unimplemented\n"); 6079 NSStatusItem *item = [[[NSStatusBar systemStatusBar] statusItemWithLength:NSSquareStatusItemLength] retain];
6080 NSImage *image = icon;
6081 [item setImage:image];
6082 if(bubbletext)
6083 [item setToolTip:[NSString stringWithUTF8String:bubbletext]];
6084 [item setTarget:handle];
6085 [item setEnabled:YES];
6086 [item setHighlightMode:YES];
6087 [item sendActionOn:(NSLeftMouseUpMask|NSLeftMouseDownMask|NSRightMouseUpMask|NSRightMouseDownMask)];
6088 dw_window_set_data(handle, "_dw_taskbar", item);
6080 } 6089 }
6081 6090
6082 /* 6091 /*
6083 * Deletes an icon from the taskbar. 6092 * Deletes an icon from the taskbar.
6084 * Parameters: 6093 * Parameters:
6085 * handle: Window handle that was used with dw_taskbar_insert(). 6094 * handle: Window handle that was used with dw_taskbar_insert().
6086 * icon: Icon handle that was used with dw_taskbar_insert(). 6095 * icon: Icon handle that was used with dw_taskbar_insert().
6087 */ 6096 */
6088 void API dw_taskbar_delete(HWND handle, HICN icon) 6097 void API dw_taskbar_delete(HWND handle, HICN icon)
6089 { 6098 {
6090 NSLog(@"dw_taskbar_delete() unimplemented\n"); 6099 NSStatusItem *item = dw_window_get_data(handle, "_dw_taskbar");
6100 [item release];
6091 } 6101 }
6092 6102
6093 /* 6103 /*
6094 * Obtains an icon from a module (or header in GTK). 6104 * Obtains an icon from a module (or header in GTK).
6095 * Parameters: 6105 * Parameters: