comparison dwt/widgets/TabItem.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
343 public override void setText (String string) { 343 public override void setText (String string) {
344 checkWidget (); 344 checkWidget ();
345 if (string is null) error (DWT.ERROR_NULL_ARGUMENT); 345 if (string is null) error (DWT.ERROR_NULL_ARGUMENT);
346 super.setText (string); 346 super.setText (string);
347 char [] chars = fixMnemonic (string); 347 char [] chars = fixMnemonic (string);
348 char* buffer = tango.stdc.stringz.toStringz( chars); 348 OS.gtk_label_set_text_with_mnemonic (labelHandle, chars.toStringzValidPtr() );
349 OS.gtk_label_set_text_with_mnemonic (labelHandle, buffer);
350 if (string.length !is 0) { 349 if (string.length !is 0) {
351 OS.gtk_widget_show (labelHandle); 350 OS.gtk_widget_show (labelHandle);
352 } else { 351 } else {
353 OS.gtk_widget_hide (labelHandle); 352 OS.gtk_widget_hide (labelHandle);
354 } 353 }