Changeset 248:34409a2fc053
- Timestamp:
- 05/22/08 13:00:47
(4 months ago)
- Author:
- Frank Benoit <benoit@tionex.de>
- branch:
- default
- Message:
Fix call OS.gtk_label_set_text_with_mnemonic with valid ptr, even for zero length strings.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r240 |
r248 |
|
| 194 | 194 | override void createHandle (int index) { |
|---|
| 195 | 195 | state |= HANDLE; |
|---|
| 196 | | if ((style & (DWT.PUSH | DWT.TOGGLE)) is 0) state |= THEME_BACKGROUND; |
|---|
| | 196 | if ((style & (DWT.PUSH | DWT.TOGGLE)) is 0) state |= THEME_BACKGROUND; |
|---|
| 197 | 197 | int bits = DWT.ARROW | DWT.TOGGLE | DWT.CHECK | DWT.RADIO | DWT.PUSH; |
|---|
| 198 | 198 | fixedHandle = cast(GtkWidget*)OS.g_object_new (display.gtk_fixed_get_type (), null); |
|---|
| … | … | |
| 797 | 797 | text = string; |
|---|
| 798 | 798 | char [] chars = fixMnemonic (string); |
|---|
| 799 | | OS.gtk_label_set_text_with_mnemonic (cast(GtkLabel*)labelHandle, toStringz(chars)); |
|---|
| | 799 | OS.gtk_label_set_text_with_mnemonic (cast(GtkLabel*)labelHandle, chars.toStringzValidPtr() ); |
|---|
| 800 | 800 | if (image is null) OS.gtk_widget_hide (imageHandle); |
|---|
| 801 | 801 | OS.gtk_widget_show (labelHandle); |
|---|
| r238 |
r248 |
|
| 286 | 286 | text = string; |
|---|
| 287 | 287 | char [] chars = fixMnemonic (string); |
|---|
| 288 | | OS.gtk_label_set_text_with_mnemonic (cast(GtkLabel*)labelHandle, toStringz(chars)); |
|---|
| | 288 | OS.gtk_label_set_text_with_mnemonic (cast(GtkLabel*)labelHandle, chars.toStringzValidPtr()); |
|---|
| 289 | 289 | if (string.length !is 0) { |
|---|
| 290 | 290 | if (OS.gtk_frame_get_label_widget (cast(GtkFrame*)handle) is null) { |
|---|
| r240 |
r248 |
|
| 853 | 853 | } |
|---|
| 854 | 854 | char [] chars = fixMnemonic (string); |
|---|
| 855 | | char* buffer = toStringz( chars ); |
|---|
| 856 | 855 | auto label = OS.gtk_bin_get_child (cast(GtkBin*)handle); |
|---|
| 857 | | OS.gtk_label_set_text_with_mnemonic (cast(GtkLabel*)label, buffer); |
|---|
| | 856 | OS.gtk_label_set_text_with_mnemonic (cast(GtkLabel*)label, chars.toStringzValidPtr() ); |
|---|
| 858 | 857 | |
|---|
| 859 | 858 | auto ptr = cast(char*)OS.g_malloc (accelString.length + 1); |
|---|
| r240 |
r248 |
|
| 346 | 346 | super.setText (string); |
|---|
| 347 | 347 | char [] chars = fixMnemonic (string); |
|---|
| 348 | | char* buffer = tango.stdc.stringz.toStringz( chars); |
|---|
| 349 | | OS.gtk_label_set_text_with_mnemonic (labelHandle, buffer); |
|---|
| | 348 | OS.gtk_label_set_text_with_mnemonic (labelHandle, chars.toStringzValidPtr() ); |
|---|
| 350 | 349 | if (string.length !is 0) { |
|---|
| 351 | 350 | OS.gtk_widget_show (labelHandle); |
|---|
| r238 |
r248 |
|
| 614 | 614 | super.setText (string); |
|---|
| 615 | 615 | char [] chars = fixMnemonic (string); |
|---|
| 616 | | char* buffer = tango.stdc.stringz.toStringz( chars ); |
|---|
| 617 | | OS.gtk_label_set_text_with_mnemonic (labelHandle, buffer); |
|---|
| | 616 | OS.gtk_label_set_text_with_mnemonic (labelHandle, chars.toStringzValidPtr() ); |
|---|
| 618 | 617 | if (string.length !is 0) { |
|---|
| 619 | 618 | OS.gtk_widget_show (labelHandle); |
|---|
| r240 |
r248 |
|
| 992 | 992 | if (labelHandle is null) return; |
|---|
| 993 | 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 | 995 | if (string.length !is 0) { |
|---|
| 996 | 996 | OS.gtk_widget_show (labelHandle); |
|---|
| r240 |
r248 |
|
| 609 | 609 | super.setText (string); |
|---|
| 610 | 610 | char [] chars = fixMnemonic (string); |
|---|
| 611 | | char* buffer = tango.stdc.stringz.toStringz(chars); |
|---|
| 612 | | OS.gtk_label_set_text_with_mnemonic (labelHandle, buffer); |
|---|
| | 611 | OS.gtk_label_set_text_with_mnemonic (labelHandle, chars.toStringzValidPtr()); |
|---|
| 613 | 612 | if (string.length !is 0) { |
|---|
| 614 | 613 | OS.gtk_widget_show (labelHandle); |
|---|