// OverrideColor is a wrapper around gtk_widget_override_color(). func (v *Widget) OverrideColor(state StateFlags, color *gdk.RGBA) { var cColor *C.GdkRGBA if color != nil { cColor = (*C.GdkRGBA)(unsafe.Pointer((&color.RGBA))) } C.gtk_widget_override_color(v.native(), C.GtkStateFlags(state), cColor) }
// GetProperty is a wrapper around gtk_style_context_get_property(). func (v *StyleContext) GetProperty(property string, state StateFlags) (interface{}, error) { cstr := (*C.gchar)(C.CString(property)) defer C.free(unsafe.Pointer(cstr)) var gval C.GValue C.gtk_style_context_get_property(v.native(), cstr, C.GtkStateFlags(state), &gval) val := glib.ValueFromNative(unsafe.Pointer(&gval)) return val.GoValue() }
// SetState is a wrapper around gtk_style_context_set_state(). func (v *StyleContext) SetState(state StateFlags) { C.gtk_style_context_set_state(v.native(), C.GtkStateFlags(state)) }
// GetColor is a wrapper around gtk_style_context_get_color(). func (v *StyleContext) GetColor(state StateFlags) *gdk.RGBA { gdkColor := gdk.NewRGBA() C.gtk_style_context_get_color(v.native(), C.GtkStateFlags(state), (*C.GdkRGBA)(unsafe.Pointer(gdkColor.Native()))) return gdkColor }
// SetStateFlags is a wrapper around gtk_widget_set_state_flags(). func (v *Widget) SetStateFlags(stateFlags StateFlags, clear bool) { C.gtk_widget_set_state_flags(v.native(), C.GtkStateFlags(stateFlags), gbool(clear)) }
RECENT_FILTER_DISPLAY_NAME = C.GtkRecentFilterFlags(C.GTK_RECENT_FILTER_DISPLAY_NAME) RECENT_FILTER_MIME_TYPE = C.GtkRecentFilterFlags(C.GTK_RECENT_FILTER_MIME_TYPE) RECENT_FILTER_APPLICATION = C.GtkRecentFilterFlags(C.GTK_RECENT_FILTER_APPLICATION) RECENT_FILTER_GROUP = C.GtkRecentFilterFlags(C.GTK_RECENT_FILTER_GROUP) RECENT_FILTER_AGE = C.GtkRecentFilterFlags(C.GTK_RECENT_FILTER_AGE) // RegionFlags REGION_EVEN = C.GtkRegionFlags(C.GTK_REGION_EVEN) REGION_ODD = C.GtkRegionFlags(C.GTK_REGION_ODD) REGION_FIRST = C.GtkRegionFlags(C.GTK_REGION_FIRST) REGION_LAST = C.GtkRegionFlags(C.GTK_REGION_LAST) REGION_ONLY = C.GtkRegionFlags(C.GTK_REGION_ONLY) REGION_SORTED = C.GtkRegionFlags(C.GTK_REGION_SORTED) // StateFlags STATE_FLAG_NORMAL = C.GtkStateFlags(C.GTK_STATE_FLAG_NORMAL) STATE_FLAG_ACTIVE = C.GtkStateFlags(C.GTK_STATE_FLAG_ACTIVE) STATE_FLAG_PRELIGHT = C.GtkStateFlags(C.GTK_STATE_FLAG_PRELIGHT) STATE_FLAG_SELECTED = C.GtkStateFlags(C.GTK_STATE_FLAG_SELECTED) STATE_FLAG_INSENSITIVE = C.GtkStateFlags(C.GTK_STATE_FLAG_INSENSITIVE) STATE_FLAG_INCONSISTENT = C.GtkStateFlags(C.GTK_STATE_FLAG_INCONSISTENT) STATE_FLAG_FOCUSED = C.GtkStateFlags(C.GTK_STATE_FLAG_FOCUSED) STATE_FLAG_BACKDROP = C.GtkStateFlags(C.GTK_STATE_FLAG_BACKDROP) STATE_FLAG_DIR_LTR = C.GtkStateFlags(C.GTK_STATE_FLAG_DIR_LTR) STATE_FLAG_DIR_RTL = C.GtkStateFlags(C.GTK_STATE_FLAG_DIR_RTL) STATE_FLAG_LINK = C.GtkStateFlags(C.GTK_STATE_FLAG_LINK) STATE_FLAG_VISITED = C.GtkStateFlags(C.GTK_STATE_FLAG_VISITED) STATE_FLAG_CHECKED = C.GtkStateFlags(C.GTK_STATE_FLAG_CHECKED) // TargetFlags TARGET_SAME_APP = C.GtkTargetFlags(C.GTK_TARGET_SAME_APP)