Search documentation of Plushie

# Plushie.Event.WindowEvent (Plushie v0.7.2)

Copy Markdown View Source

Window lifecycle events.

## Pattern matching

    def update(model, %WindowEvent{type: :resized, window_id: "main", width: w, height: h}), do: ...
    def update(model, %WindowEvent{type: :close_requested, window_id: wid}), do: ...

## Summary

### Types

delivered_t()

Window event delivered by the renderer.

event_type()
t()

## Types

# delivered_t()

    @type delivered_t() :: t()

Window event delivered by the renderer.

# event_type()

    @type event_type() ::
      :opened
      | :closed
      | :close_requested
      | :moved
      | :resized
      | :focused
      | :unfocused
      | :rescaled
      | :file_hovered
      | :file_dropped
      | :files_hovered_left

# t()

    @type t() :: %Plushie.Event.WindowEvent{
      height: number() | nil,
      path: String.t() | nil,
      scale_factor: number() | nil,
      type: event_type(),
      width: number() | nil,
      window_id: String.t(),
      x: number() | nil,
      y: number() | nil
    }