ndv.views #
Wrappers around GUI & graphics frameworks.
Most stuff in this module is not intended for public use, but ndv.views.bases
shows the protocol that GUI & graphics classes should implement.
Modules:
-
bases
–Abstract base classes for views and viewable objects.
Classes:
-
CanvasBackend
–Enum of available canvas backends.
-
GuiFrontend
–Enum of available GUI frontends.
Functions:
-
call_later
–Call
func
aftermsec
milliseconds. -
get_array_canvas_class
–Return
ArrayCanvas
class for current canvas backend. -
get_array_view_class
–Return
ArrayView
class for current GUI frontend. -
get_histogram_canvas_class
–Return
HistogramCanvas
class for current canvas backend. -
process_events
–Force processing of events for the application.
-
run_app
–Start the active GUI application event loop.
-
set_canvas_backend
–Sets the preferred canvas backend. Cannot be set after the GUI is running.
-
set_gui_backend
–Sets the preferred GUI backend. Cannot be set after the GUI is running.
CanvasBackend #
GuiFrontend #
Enum of available GUI frontends.
Attributes:
call_later #
Call func
after msec
milliseconds.
This can be used to enqueue a function to be called after the current event loop iteration. For example, before calling run_app()
, to ensure that the event loop is running before the function is called.
Parameters:
-
msec
#int
) –The number of milliseconds to wait before calling
func
. -
func
#Callable[[], None]
) –The function to call.
Source code in src/ndv/views/_app.py
325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 |
|
get_array_canvas_class #
get_array_canvas_class(
backend: str | None = None,
) -> type[ArrayCanvas]
Return ArrayCanvas
class for current canvas backend.
Source code in src/ndv/views/_app.py
291 292 293 294 295 296 |
|
get_array_view_class #
Return ArrayView
class for current GUI frontend.
Source code in src/ndv/views/_app.py
286 287 288 |
|
get_histogram_canvas_class #
get_histogram_canvas_class(
backend: str | None = None,
) -> type[HistogramCanvas]
Return HistogramCanvas
class for current canvas backend.
Source code in src/ndv/views/_app.py
299 300 301 302 303 304 |
|
process_events #
process_events() -> None
Force processing of events for the application.
Source code in src/ndv/views/_app.py
342 343 344 |
|
run_app #
run_app() -> None
Start the active GUI application event loop.
Source code in src/ndv/views/_app.py
347 348 349 |
|
set_canvas_backend #
set_canvas_backend(
backend: Literal["pygfx", "vispy"] | None = None,
) -> None
Sets the preferred canvas backend. Cannot be set after the GUI is running.
Source code in src/ndv/views/_app.py
227 228 229 230 231 232 233 234 |
|
set_gui_backend #
set_gui_backend(
backend: Literal["jupyter", "qt", "wx"] | None = None,
) -> None
Sets the preferred GUI backend. Cannot be set after the GUI is running.
Source code in src/ndv/views/_app.py
237 238 239 240 241 242 243 244 |
|