Mercurial > projects > dwt-linux
comparison dwt/widgets/TrayItem.d @ 238:380bad9f6852
reverted char[] to String
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Mon, 05 May 2008 00:42:55 +0200 |
parents | 17f8449522fd |
children | 5a30aa9820f3 |
comparison
equal
deleted
inserted
replaced
237:98b80b00af79 | 238:380bad9f6852 |
---|---|
9 * IBM Corporation - initial API and implementation | 9 * IBM Corporation - initial API and implementation |
10 * Port to the D programming language: | 10 * Port to the D programming language: |
11 * Frank Benoit <benoit@tionex.de> | 11 * Frank Benoit <benoit@tionex.de> |
12 *******************************************************************************/ | 12 *******************************************************************************/ |
13 module dwt.widgets.TrayItem; | 13 module dwt.widgets.TrayItem; |
14 | |
15 import dwt.dwthelper.utils; | |
14 | 16 |
15 import dwt.DWT; | 17 import dwt.DWT; |
16 import dwt.widgets.Tray; | 18 import dwt.widgets.Tray; |
17 import dwt.widgets.ToolTip; | 19 import dwt.widgets.ToolTip; |
18 import dwt.widgets.ImageList; | 20 import dwt.widgets.ImageList; |
47 * @since 3.0 | 49 * @since 3.0 |
48 */ | 50 */ |
49 public class TrayItem : Item { | 51 public class TrayItem : Item { |
50 Tray parent; | 52 Tray parent; |
51 ToolTip toolTip; | 53 ToolTip toolTip; |
52 char[] toolTipText; | 54 String toolTipText; |
53 GtkWidget* imageHandle; | 55 GtkWidget* imageHandle; |
54 GtkWidget* tooltipsHandle; | 56 GtkWidget* tooltipsHandle; |
55 ImageList imageList; | 57 ImageList imageList; |
56 | 58 |
57 /** | 59 /** |
172 int monitor = 0; | 174 int monitor = 0; |
173 auto screen = OS.gdk_screen_get_default (); | 175 auto screen = OS.gdk_screen_get_default (); |
174 if (screen !is null) { | 176 if (screen !is null) { |
175 monitor = OS.gdk_screen_get_number (screen); | 177 monitor = OS.gdk_screen_get_number (screen); |
176 } | 178 } |
177 auto trayAtom = OS.gdk_atom_intern (toStringz("_NET_SYSTEM_TRAY_S" ~ to!(char[])(monitor)), true); | 179 auto trayAtom = OS.gdk_atom_intern (toStringz("_NET_SYSTEM_TRAY_S" ~ to!(String)(monitor)), true); |
178 auto xTrayAtom = OS.gdk_x11_atom_to_xatom (trayAtom); | 180 auto xTrayAtom = OS.gdk_x11_atom_to_xatom (trayAtom); |
179 auto xDisplay = OS.GDK_DISPLAY (); | 181 auto xDisplay = OS.GDK_DISPLAY (); |
180 auto trayWindow = OS.XGetSelectionOwner (xDisplay, xTrayAtom); | 182 auto trayWindow = OS.XGetSelectionOwner (xDisplay, xTrayAtom); |
181 auto messageAtom = OS.gdk_atom_intern (toStringz("_NET_SYSTEM_TRAY_OPCODE"), true); | 183 auto messageAtom = OS.gdk_atom_intern (toStringz("_NET_SYSTEM_TRAY_OPCODE"), true); |
182 auto xMessageAtom = OS.gdk_x11_atom_to_xatom (messageAtom); | 184 auto xMessageAtom = OS.gdk_x11_atom_to_xatom (messageAtom); |
246 * @exception DWTException <ul> | 248 * @exception DWTException <ul> |
247 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> | 249 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
248 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> | 250 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
249 * </ul> | 251 * </ul> |
250 */ | 252 */ |
251 public char[] getToolTipText () { | 253 public String getToolTipText () { |
252 checkWidget (); | 254 checkWidget (); |
253 return toolTipText; | 255 return toolTipText; |
254 } | 256 } |
255 | 257 |
256 override int /*long*/ gtk_button_press_event (GtkWidget* widget, GdkEventButton* event) { | 258 override int /*long*/ gtk_button_press_event (GtkWidget* widget, GdkEventButton* event) { |
460 * @exception DWTException <ul> | 462 * @exception DWTException <ul> |
461 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> | 463 * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
462 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> | 464 * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
463 * </ul> | 465 * </ul> |
464 */ | 466 */ |
465 public void setToolTipText (char[] string) { | 467 public void setToolTipText (String string) { |
466 checkWidget (); | 468 checkWidget (); |
467 toolTipText = string; | 469 toolTipText = string; |
468 char* buffer = null; | 470 char* buffer = null; |
469 if (string !is null && string.length > 0) { | 471 if (string !is null && string.length > 0) { |
470 buffer = toStringz( string ); | 472 buffer = toStringz( string ); |