Skip to content

EventBox

class EventBox (events: Literal['exposure', 'pointer-motion', 'pointer-motion-hint', 'button-motion', 'button-1-motion', 'button-2-motion', 'button-3-motion', 'button-press', 'button-release', 'key-press', 'key-release', 'enter-notify', 'leave-notify', 'focus-change', 'structure', 'property-change', 'visibility-notify', 'proximity-in', 'proximity-out', 'substructure', 'scroll', 'touch', 'smooth-scroll', 'touchpad-gesture', 'tablet-pad', 'all'] | EventMask | Iterable[Literal['exposure', 'pointer-motion', 'pointer-motion-hint', 'button-motion', 'button-1-motion', 'button-2-motion', 'button-3-motion', 'button-press', 'button-release', 'key-press', 'key-release', 'enter-notify', 'leave-notify', 'focus-change', 'structure', 'property-change', 'visibility-notify', 'proximity-in', 'proximity-out', 'substructure', 'scroll', 'touch', 'smooth-scroll', 'touchpad-gesture', 'tablet-pad', 'all'] | EventMask] | None = None, child: Widget | None = None, name: str | None = None, visible: bool = True, all_visible: bool = False, style: str | None = None, style_classes: Iterable[str] | str | None = None, tooltip_text: str | None = None, tooltip_markup: str | None = None, h_align: Literal['fill', 'start', 'end', 'center', 'baseline'] | Align | None = None, v_align: Literal['fill', 'start', 'end', 'center', 'baseline'] | Align | None = None, h_expand: bool = False, v_expand: bool = False, size: Iterable[int] | int | None = None, **kwargs)

Bases: EventBox, Container

A simple container for catching a given set of events

Useful for adding interactivity with widgets that can’t normally interact to specific events

  • Parameters:
    • events (EVENT_TYPE | Gdk.EventMask | Iterable *[*EVENT_TYPE | Gdk.EventMask ] | None , optional) — the event (or list of events) this eventbox can receive, defaults to None
    • name (str | None , optional) — the name identifer for this widget (useful for styling), defaults to None
    • visible (bool , optional) — whether should this widget be visible or not once initialized, defaults to True
    • all_visible (bool , optional) — whether should this widget and all of its children be visible or not once initialized, defaults to False
    • style (str | None , optional) — inline stylesheet to be applied on this widget, defaults to None
    • style_classes (Iterable *[*str ] | str | None , optional) — a list of style classes to be added into this widget once initialized, defaults to None
    • tooltip_text (str | None , optional) — the text that should be rendered inside the tooltip, defaults to None
    • tooltip_markup (str | None , optional) — same as tooltip_text but it accepts simple markup expressions, defaults to None
    • h_align (Literal [ “fill” , “start” , “end” , “center” , “baseline” ] | Gtk.Align | None , optional) — horizontal alignment of this widget (compared to its parent), defaults to None
    • v_align (Literal [ “fill” , “start” , “end” , “center” , “baseline” ] | Gtk.Align | None , optional) — vertical alignment of this widget (compared to its parent), defaults to None
    • h_expand (bool , optional) — whether should this widget fill in all the available horizontal space or not, defaults to False
    • v_expand (bool , optional) — whether should this widget fill in all the available vertical space or not, defaults to False
    • size (Iterable *[*int ] | int | None , optional) — a fixed size for this widget (not guranteed to get applied), defaults to None