View Source Desktop.Env (Desktop v1.5.3)
Env holds any needed :wx / Desktop application state. Currently it keeps track of
- The open Desktop.Window(s),
- OS Application events (such as when a file is dragged on the application icon)
- The :wx environment
- The dbus connection (sni) on linux
Also it has a global connect() method to allow binding of :wx event callbacks using this long lived process as reference.
Summary
Functions
Returns the currently used webview backend
Returns a specification to start this module under a supervisor.
Returns the raw ExSni handle if used under linux to talk to DBus.
Wrapper around wx.subscribe()
Returns the wx object. This is what has been created by the application using :wx.new/1
. You
typically need a reference to this to execute raw :wx
commands.
Gets the Desktop process's current raw :wx
environment.
Can be sent to other processes to allow them use this process wx environment.
Shortcut for :wx.set_env(Desktop.Env.wx_env())
Functions
Returns the currently used webview backend
Returns a specification to start this module under a supervisor.
See Supervisor
.
Returns the raw ExSni handle if used under linux to talk to DBus.
Wrapper around wx.subscribe()
Will send to the calling process events in the form:
{:print_file, [filename]}
{:open_file, [filename]}
{:open_url, [filename]}
{:new_file, []}
Returns the wx object. This is what has been created by the application using :wx.new/1
. You
typically need a reference to this to execute raw :wx
commands.
Gets the Desktop process's current raw :wx
environment.
Can be sent to other processes to allow them use this process wx environment.
Example
iex> :wx.set_env(Desktop.Env.wx_env())
iex> :wxWebView.isContextMenuEnabled(Desktop.Window.webview(pid))
false
Shortcut for :wx.set_env(Desktop.Env.wx_env())