fsleyes_widgets.bitmaptoggle

This module provides the BitmapToggleButton class, a button which toggles between two bitmaps.

class fsleyes_widgets.bitmaptoggle.BitmapToggleButton(parent, *args, **kwargs)[source]

Bases: ToggleButton

A wx.ToggleButton which stores a boolean state (True/False), and displays one of two bitmaps depending on the state.

When the user presses the button, the boolean state and the displayed bitmap changes accordingly. A EVT_BITMAP_TOGGLE event is generated on button presses.

Create a BitmapToggleButton.

Parameters:
  • parent – The wx parent window.

  • trueBmp – Required. A wx.Bitmap to display when the button state is True.

  • falseBmp – Optional. A wx.Bitmap to display when the button state is False.

All other arguemnts are passed through to the wx.ToggleButton.__init__ method.

SetBitmap(bitmap, dir=LEFT)[source]

Sets the bitmap to display in the button.

SetValue(state)[source]

Sets the current boolean state of this BitmapToggleButton.

fsleyes_widgets.bitmaptoggle.EVT_BITMAP_TOGGLE = <wx.core.PyEventBinder object>

Identifier for the BitmapToggleEvent event.

fsleyes_widgets.bitmaptoggle.BitmapToggleEvent

Event emitted when a BitmapToggleButton is pushed.

Contains one attribute, value, which contains the current button state (True or False).