Changeset 207:12feeed18183
- Timestamp:
- 03/09/08 05:58:49
(6 months ago)
- Author:
- Frank Benoit <benoit@tionex.de>
- branch:
- default
- Message:
Allow Label.setText with null argument.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r200 |
r207 |
|
| 321 | 321 | } |
|---|
| 322 | 322 | |
|---|
| | 323 | public char* toStringzValidPtr( char[] src ){ |
|---|
| | 324 | if( src ){ |
|---|
| | 325 | return src.toStringz(); |
|---|
| | 326 | } |
|---|
| | 327 | else{ |
|---|
| | 328 | static const char[] nullPtr = "\0"; |
|---|
| | 329 | return nullPtr.ptr; |
|---|
| | 330 | } |
|---|
| | 331 | } |
|---|
| | 332 | |
|---|
| 323 | 333 | static char[] toHex(uint value, bool prefix = true, int radix = 8){ |
|---|
| 324 | 334 | return tango.text.convert.Integer.toString( |
|---|
| r152 |
r207 |
|
| 22 | 22 | import dwt.widgets.ImageList; |
|---|
| 23 | 23 | |
|---|
| 24 | | import tango.stdc.stringz; |
|---|
| | 24 | import dwt.dwthelper.utils; |
|---|
| 25 | 25 | |
|---|
| 26 | 26 | /** |
|---|
| … | … | |
| 568 | 568 | public void setText (char[] string) { |
|---|
| 569 | 569 | checkWidget (); |
|---|
| 570 | | if (string is null) error (DWT.ERROR_NULL_ARGUMENT); |
|---|
| | 570 | // DWT extension: allow null for zero length string |
|---|
| | 571 | //if (string is null) error (DWT.ERROR_NULL_ARGUMENT); |
|---|
| 571 | 572 | if ((style & DWT.SEPARATOR) !is 0) return; |
|---|
| 572 | 573 | text = string; |
|---|
| 573 | 574 | char [] chars = fixMnemonic (string); |
|---|
| 574 | | OS.gtk_label_set_text_with_mnemonic (cast(GtkLabel*)labelHandle, toStringz(chars)); |
|---|
| | 575 | OS.gtk_label_set_text_with_mnemonic (cast(GtkLabel*)labelHandle, chars.toStringzValidPtr()); |
|---|
| 575 | 576 | OS.gtk_widget_hide (imageHandle); |
|---|
| 576 | 577 | OS.gtk_widget_show (labelHandle); |
|---|