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)[source]

Bases: 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()[source]

Returns the place holder text.

GetPlaceholderColour()[source]

Returns the placeholder text colour.

SetPlaceholder(placeholder)[source]

Sets the placeholder text.

SetPlaceholderColour(colour)[source]

Sets the placeholder text colour.

GetValue()[source]

Returns the value currently contained in this PlaceholderTextCtrl.

SetValue(value)[source]

Set the value in this PlaceholderTextCtrl.