comparison dwt/widgets/ToolItem.d @ 248:34409a2fc053

Fix call OS.gtk_label_set_text_with_mnemonic with valid ptr, even for zero length strings.
author Frank Benoit <benoit@tionex.de>
date Thu, 22 May 2008 19:00:47 +0200
parents ce446666f5a2
children 5a30aa9820f3
comparison
equal deleted inserted replaced
247:da992144273f 248:34409a2fc053
989 if (string is null) error (DWT.ERROR_NULL_ARGUMENT); 989 if (string is null) error (DWT.ERROR_NULL_ARGUMENT);
990 if ((style & DWT.SEPARATOR) !is 0) return; 990 if ((style & DWT.SEPARATOR) !is 0) return;
991 super.setText (string); 991 super.setText (string);
992 if (labelHandle is null) return; 992 if (labelHandle is null) return;
993 char [] chars = fixMnemonic (string); 993 char [] chars = fixMnemonic (string);
994 OS.gtk_label_set_text_with_mnemonic (labelHandle, toStringz(chars)); 994 OS.gtk_label_set_text_with_mnemonic (labelHandle, chars.toStringzValidPtr());
995 if (string.length !is 0) { 995 if (string.length !is 0) {
996 OS.gtk_widget_show (labelHandle); 996 OS.gtk_widget_show (labelHandle);
997 } else { 997 } else {
998 OS.gtk_widget_hide (labelHandle); 998 OS.gtk_widget_hide (labelHandle);
999 } 999 }