static gboolean gtkQueryTooltip(GtkWidget *widget, gint x, gint y, gboolean keyboard_mode, GtkTooltip *tooltip, Ihandle* ih) { char* value = iupAttribGet(ih, "TIPRECT"); if (value && !keyboard_mode) { GdkRectangle rect; int x1, x2, y1, y2; sscanf(value, "%d %d %d %d", &x1, &y1, &x2, &y2); rect.x = x1; rect.y = y1; rect.width = x2-x1+1; rect.height = y2-y1+1; gtk_tooltip_set_tip_area(tooltip, &rect); } else gtk_tooltip_set_tip_area(tooltip, NULL); value = iupAttribGet(ih, "TIPICON"); if (!value) gtk_tooltip_set_icon(tooltip, NULL); else { GdkPixbuf* icon = (GdkPixbuf*)iupImageGetIcon(value); if (icon) gtk_tooltip_set_icon(tooltip, icon); } (void)y; (void)x; (void)widget; return FALSE; }
static int gtkDialogSetTrayImageAttrib(Ihandle *ih, const char *value) { GtkStatusIcon* status_icon = gtkDialogGetStatusIcon(ih); GdkPixbuf* icon = (GdkPixbuf*)iupImageGetIcon(value); gtk_status_icon_set_from_pixbuf(status_icon, icon); return 1; }
static int winDialogSetIconAttrib(Ihandle* ih, const char *value) { if (!value) { SendMessage(ih->handle, WM_SETICON, (WPARAM)ICON_SMALL, (LPARAM)NULL); SendMessage(ih->handle, WM_SETICON, (WPARAM)ICON_BIG, (LPARAM)NULL); } else { /* check first in the resources using size hits */ HICON icon = winDialogLoadIcon(value, ICON_SMALL); if (icon) SendMessage(ih->handle, WM_SETICON, (WPARAM)ICON_SMALL, (LPARAM)icon); icon = winDialogLoadIcon(value, ICON_BIG); if (icon) SendMessage(ih->handle, WM_SETICON, (WPARAM)ICON_BIG, (LPARAM)icon); else { icon = iupImageGetIcon(value); if (icon) SendMessage(ih->handle, WM_SETICON, (WPARAM)ICON_BIG, (LPARAM)icon); } } if (IsIconic(ih->handle)) RedrawWindow(ih->handle, NULL, NULL, RDW_INVALIDATE|RDW_ERASE|RDW_UPDATENOW); /* redraw the icon */ else RedrawWindow(ih->handle, NULL, NULL, RDW_FRAME|RDW_UPDATENOW); /* only the frame needs to be redrawn */ return 1; }
static int winDialogSetTrayImageAttrib(Ihandle *ih, const char *value) { if (winDialogCheckTray(ih)) { HICON hIcon = (HICON)iupImageGetIcon(value); if (hIcon) winDialogTrayMessage(ih->handle, NIM_MODIFY, hIcon, NULL); } return 1; }
static int gtkDialogSetIconAttrib(Ihandle* ih, const char *value) { if (!value) gtk_window_set_icon((GtkWindow*)ih->handle, NULL); else { GdkPixbuf* icon = (GdkPixbuf*)iupImageGetIcon(value); if (icon) gtk_window_set_icon((GtkWindow*)ih->handle, icon); } return 1; }
static int motDialogSetIconAttrib(Ihandle* ih, const char *value) { if (!value) XtVaSetValues(ih->handle, XmNiconPixmap, NULL, NULL); else { Pixmap icon = (Pixmap)iupImageGetIcon(value); if (icon) XtVaSetValues(ih->handle, XmNiconPixmap, icon, NULL); } return 1; }
static int winDialogSetIconAttrib(Ihandle* ih, const char *value) { if (!value) SendMessage(ih->handle, WM_SETICON, (WPARAM)ICON_BIG, (LPARAM)NULL); else { HICON icon = iupImageGetIcon(value); if (icon) SendMessage(ih->handle, WM_SETICON, (WPARAM) ICON_BIG, (LPARAM)icon); } if (IsIconic(ih->handle)) RedrawWindow(ih->handle, NULL, NULL, RDW_INVALIDATE|RDW_ERASE|RDW_UPDATENOW); /* redraw the icon */ else RedrawWindow(ih->handle, NULL, NULL, RDW_FRAME|RDW_UPDATENOW); /* only the frame needs to be redrawn */ return 1; }