static gboolean gtkButtonEvent(GtkWidget *widget, GdkEventButton *evt, Ihandle *ih) { if (iupgtkButtonEvent(widget, evt, ih)==TRUE) return TRUE; if (ih->data->type & IUP_BUTTON_IMAGE) { char* name = iupAttribGet(ih, "IMPRESS"); if (name) { if (evt->type == GDK_BUTTON_PRESS) gtkButtonSetPixbuf(ih, name, 0); else { name = iupAttribGet(ih, "IMAGE"); gtkButtonSetPixbuf(ih, name, 0); } } if (evt->type == GDK_BUTTON_RELEASE && iupAttribGet(ih, "_IUPGTK_EVENTBOX")) { Icallback cb = IupGetCallback(ih, "ACTION"); if (cb) { if (cb(ih) == IUP_CLOSE) IupExitLoop(); } } } return FALSE; }
static gboolean gtkCanvasButtonEvent(GtkWidget *widget, GdkEventButton *evt, Ihandle *ih) { if (evt->type == GDK_BUTTON_PRESS) { /* Force focus on canvas click */ if (iupAttribGetBoolean(ih, "CANFOCUS")) gtk_widget_grab_focus(ih->handle); } return iupgtkButtonEvent(widget, evt, ih); }
static gboolean gtkTabsButtonPressEvent(GtkWidget *widget, GdkEventButton *evt, Ihandle *child) { Ihandle* ih = IupGetParent(child); IFni cb = (IFni)IupGetCallback(ih, "RIGHTCLICK_CB"); if (evt->type == GDK_BUTTON_PRESS && evt->button == 3 && cb) { GtkWidget* tab_page = (GtkWidget*)iupAttribGet(child, "_IUPTAB_PAGE"); int pos = gtk_notebook_page_num((GtkNotebook*)ih->handle, tab_page); cb(ih, pos); } (void)widget; return iupgtkButtonEvent(widget, evt, ih); }