fsleyes_widgets.placeholder_textctrl

This module provides the PlaceholderTextCtrl which is a wx.TextCtrl that displays some placeholder text when it is empty and unfocused.

class fsleyes_widgets.placeholder_textctrl.PlaceholderTextCtrl(*args, **kwargs)

Bases: wx._core.TextCtrl

the PlaceholderTextCtrl is a wx.TextCtrl that displays some placeholder text when it is empty and unfocused.

I wrote this class as a substitute for the wx.SearchCtrl which, under OSX Cocoa (wxPython 3.0.2.0) has focusing bugs that make it unusable.

Create a PlaceholderTextCtrl.

Parameters
  • placeholder – The text to display when the control is empty and unfocused.

  • placeholderColour – Colour to display the placeholder text in.

All other arguments are passed to wx.TextCtrl.__init__.

GetPlaceholder()

Returns the place holder text.

GetPlaceholderColour()

Returns the placeholder text colour.

SetPlaceholder(placeholder)

Sets the placeholder text.

SetPlaceholderColour(colour)

Sets the placeholder text colour.

GetValue()

Returns the value currently contained in this PlaceholderTextCtrl.

SetValue(value)

Set the value in this PlaceholderTextCtrl.