Mercurial > dwindows
comparison os2/dw.c @ 1400:ccd383e11ff8
Allow removing of tooltips by passing NULL or "" and prevent double tooltips on some platforms.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Sun, 27 Nov 2011 20:28:15 +0000 |
parents | 152e3c8916de |
children | 56f311dc23f6 |
comparison
equal
deleted
inserted
replaced
1399:8e569dd09d94 | 1400:ccd383e11ff8 |
---|---|
6391 */ | 6391 */ |
6392 void API dw_window_set_tooltip(HWND handle, char *bubbletext) | 6392 void API dw_window_set_tooltip(HWND handle, char *bubbletext) |
6393 { | 6393 { |
6394 HWND buddy = (HWND)dw_window_get_data(handle, "_dw_comboentry"); | 6394 HWND buddy = (HWND)dw_window_get_data(handle, "_dw_comboentry"); |
6395 WindowData *blah = (WindowData *)WinQueryWindowPtr(buddy ? buddy : handle, QWP_USER); | 6395 WindowData *blah = (WindowData *)WinQueryWindowPtr(buddy ? buddy : handle, QWP_USER); |
6396 char *text = bubbletext ? bubbletext : ""; | |
6396 | 6397 |
6397 buddy = (HWND)dw_window_get_data(handle, "_dw_buddy"); | 6398 buddy = (HWND)dw_window_get_data(handle, "_dw_buddy"); |
6398 | 6399 |
6399 if(blah) | 6400 if(blah) |
6400 strncpy(blah->bubbletext, bubbletext, BUBBLE_HELP_MAX - 1); | 6401 strncpy(blah->bubbletext, text, BUBBLE_HELP_MAX - 1); |
6401 if(buddy && (blah = (WindowData *)WinQueryWindowPtr(buddy, QWP_USER))) | 6402 if(buddy && (blah = (WindowData *)WinQueryWindowPtr(buddy, QWP_USER))) |
6402 strncpy(blah->bubbletext, bubbletext, BUBBLE_HELP_MAX - 1); | 6403 strncpy(blah->bubbletext, text, BUBBLE_HELP_MAX - 1); |
6403 } | 6404 } |
6404 | 6405 |
6405 /* | 6406 /* |
6406 * Gets the text used for a given window. | 6407 * Gets the text used for a given window. |
6407 * Parameters: | 6408 * Parameters: |