fsleyes_widgets.utils

This package contains a collection of small utility modules for doing random things. A few functions are also defined at the package level:

wxversion

Determines the version of wxPython being used.

isalive

Returns True if the given wx.Window object is “alive” (i.e.

fsleyes_widgets.utils.WX_PYTHON = 1

Constant returned by the wxversion function, indicating that wxPython 3.0.2.0 or older is being used.

fsleyes_widgets.utils.WX_PHOENIX = 2

Constant returned by the wxversion function, indicating that wxPython/Phoenix (>= 3.0.3) is being used.

fsleyes_widgets.utils.wxversion()

Determines the version of wxPython being used. Returns either WX_PYTHON or WX_PHOENIX.

fsleyes_widgets.utils.isalive(widget)

Returns True if the given wx.Window object is “alive” (i.e. has not been destroyed), False otherwise. Works in both wxPython and wxPython/Phoenix.

Warning

Don’t try to test whether a wx.MenuItem has been destroyed, as it will probably result in segmentation faults. Check the parent wx.Menu instead.