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.TextCtrlthe
PlaceholderTextCtrlis awx.TextCtrlthat displays some placeholder text when it is empty and unfocused.I wrote this class as a substitute for the
wx.SearchCtrlwhich, 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__.-
__init__(*args, **kwargs)¶ 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.
-
_PlaceholderTextCtrl__onKillFocus(ev)¶ Called when this
PlaceholderTextCtrlloses focus.Displays the placeholder text if necessary.
-
_PlaceholderTextCtrl__onSetFocus(ev)¶ Called when this
PlaceholderTextCtrlgains focus.Clears the placeholder text if necessary.
-
__module__= 'fsleyes_widgets.placeholder_textctrl'¶