DevJoy.Scene.Menu (DevJoy v2.0.0)

View Source

The menu is visually represented as a titled list with buttons for navigating between the different scenes and their parts.

Usage

The menu always requires its title and possible choices. You can also optionally specify additional data.

defmodule MyApp.SceneName do
  use DevJoy.Scene

  part :menu do
    menu "Menu title" do
      choice "Menu item content", goto(:part_name)
    end
  end
end

Summary

Field types

The type representing the additional data for the menu.

The type representing the title of the menu.

Main

The menu structure contains the following keys

t()

The type representing the menu structure.

Field types

data()

@type data() :: Keyword.t()

The type representing the additional data for the menu.

title()

@type title() :: String.t()

The type representing the title of the menu.

Main

%DevJoy.Scene.Menu{}

(struct)

The menu structure contains the following keys:

  • data - a keyword list of additional data for the menu
  • title - a title of the menu

t()

@type t() :: %DevJoy.Scene.Menu{data: data(), title: title()}

The type representing the menu structure.