diff 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
line wrap: on
line diff
--- a/mac/dw.m	Sun Oct 09 12:52:16 2011 +0000
+++ b/mac/dw.m	Mon Oct 10 00:40:22 2011 +0000
@@ -6076,7 +6076,16 @@
  */
 void API dw_taskbar_insert(HWND handle, HICN icon, char *bubbletext)
 {
-    NSLog(@"dw_taskbar_insert() unimplemented\n");
+    NSStatusItem *item = [[[NSStatusBar systemStatusBar] statusItemWithLength:NSSquareStatusItemLength] retain];
+    NSImage *image = icon;
+    [item setImage:image];
+    if(bubbletext)
+        [item setToolTip:[NSString stringWithUTF8String:bubbletext]];
+    [item setTarget:handle];
+    [item setEnabled:YES];
+    [item setHighlightMode:YES];
+    [item sendActionOn:(NSLeftMouseUpMask|NSLeftMouseDownMask|NSRightMouseUpMask|NSRightMouseDownMask)];
+    dw_window_set_data(handle, "_dw_taskbar", item);
 }
 
 /*
@@ -6087,7 +6096,8 @@
  */
 void API dw_taskbar_delete(HWND handle, HICN icon)
 {
-    NSLog(@"dw_taskbar_delete() unimplemented\n");
+    NSStatusItem *item = dw_window_get_data(handle, "_dw_taskbar");
+    [item release];
 }
 
 /*