win_notify v0.0.4 WinNotify

Summary

Macros

Creates a helper function for commonly used alerts when used in the do block of notify_icon/3

Defines a notification icon process

Defines a notification icon process

Types

notify_level :: :info | :warning | :error

Macros

defalert(name, level, title, format)

Creates a helper function for commonly used alerts when used in the do block of notify_icon/3.

Example

defmodule Foo do
  import WinNotify

  notify_icon "Foo", "/path/to/icon.ico" do
    defalert :bar, :warning, "Unexpected Result", "Got: ~f; Expected ~f;"
  end
end

Defines Foo.bar/1 which takes a list of terms to format the message with.

notify_icon(text, icon)

Defines a notification icon process.

Example

defmodule Foo do
  import WinNotify

  notify_icon "Foo", "/path/to/icon.ico"
end

Defined Functions

The following functions will be defined in the module the macro is invoked in:

  1. info(title, text)
  2. warning(title, text)
  3. error(title, text)
notify_icon(text, icon, list)

Defines a notification icon process.

Example

defmodule Foo do
  import WinNotify

  notify_icon "Foo", "/path/to/icon.ico" do
    defalert :bar, :warning, "Unexpected Result", "Got: ~f; Expected ~f;"
  end
end

iex> Foo.start_link
iex> Foo.bar [5.1, 2.4] # (warning alert with text "Got: 5.1; Expected 2.4;")
iex> :ok

Defined Functions

See notify_icon/2