File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed
Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -887,7 +887,11 @@ defmodule Scenic.Driver do
887887 name: [ type: :atom ]
888888 ]
889889
890- @ doc false
890+ @ doc """
891+ Validate driver configuration
892+
893+ Used primarily for dynamic view port creation
894+ """
891895 def validate ( [ ] ) , do: { :ok , [ ] }
892896
893897 def validate ( drivers ) do
Original file line number Diff line number Diff line change @@ -91,6 +91,20 @@ defmodule Scenic.ViewPort do
9191 leave the scene that thinks it has "captured" the input in an inconsistent
9292 state, so this is not recommended.
9393
94+ ## Dynamically Creating View Ports
95+
96+ Pass in the same set of opts that you would use when starting `Scenic` in your
97+ supervision tree. For example:
98+
99+ opts = [
100+ name: name,
101+ module: Scenic.Driver.Local,
102+ window: [resizeable: false, title: "My Example Scenic App"],
103+ on_close: :stop_system
104+ ]
105+
106+ {:ok, [opts]} = Scenic.Driver.validate([opts])
107+ Scenic.ViewPort.start_driver(view_port, opts)
94108 """
95109
96110 @ type t :: % ViewPort {
You can’t perform that action at this time.
0 commit comments