EventBox#

class ignis.widgets.Widget.EventBox(scroll_flags: gi.repository.Gtk.EventControllerScrollFlags = gi.repository.Gtk.EventControllerScrollFlags.BOTH_AXES, **kwargs)#

Bases: Box

The same Box, but it can receive events.

Parameters:
  • scroll_flags (EventControllerScrollFlags, default: gi.repository.Gtk.EventControllerScrollFlags.BOTH_AXES) -- Flags affecting the Gtk.EventControllerScroll behavior.

  • **kwargs -- Properties to set.

Widget.EventBox(
    child=[Widget.Label(label='this is eventbox'), Widget.Label(label="It can contain multiple child as Widget.Box")],
    vertical=True,
    homogeneous=False,
    spacing=52,
    on_click=lambda self: print("clicked!"),
    on_right_click=lambda self: print("right clicked!"),
    on_middle_click=lambda self: print("middle clicked!"),
    on_hover=lambda self: print("hovered!"),
    on_hover_lost=lambda self: print("hover lost((("),
    on_scroll_up=lambda self: print("scrolled up!"),
    on_scroll_down=lambda self: print("scrolled down!")
    on_scroll_right=lambda self: print("scrolled right!")
    on_scroll_left=lambda self: print("scrolled left!"),
)
gproperty on_click: Callable#
  • read-write

The function to call on left click.

gproperty on_right_click: Callable#
  • read-write

The function to call on right click.

gproperty on_middle_click: Callable#
  • read-write

The function to call on middle click.

gproperty on_hover: Callable#
  • read-write

The function to call on hover.

gproperty on_hover_lost: Callable#
  • read-write

The function to call on hover lost.

gproperty scroll_flags: gi.repository.Gtk.EventControllerScrollFlags#
  • read-only

Flags affecting the Gtk.EventControllerScroll behavior.

gproperty on_scroll_up: Callable#
  • read-write

The function to call on scroll up.

gproperty on_scroll_down: Callable#
  • read-write

The function to call on scroll down.

gproperty on_scroll_right: Callable#
  • read-write

The function to call on scroll right.

gproperty on_scroll_left: Callable#
  • read-write

The function to call on scroll left.