matplotlib/matplotlib — pull request #1983 by keflavich (2013-05-07 13:58:47+00:00)
Title: Added a TextBox widget

This PR adds an editable TextBox widget based on the text box on some ancient mailing list threads. It adds some features:

* movable cursor (with left/right arrow)
* backspace works
* restricts values to floats
* has an `activate` callback (so you click on it to edit)
* has an `enter` callback (pressing enter does something)
* deactivates other key bindings when active (so typing `s` doesn't activate the save dialog)

I can add some example usage, but it would be helpful to have some initial feedback. It would certainly be preferable to have a fully-active text box (i.e., one where mouse-highlighting, shift-selection, etc.) can be used to edit the text, but frankly that seems overwhelming at the moment.

The main use-case for this text box is changing numbers directly. I've used it specifically for communication with a slider: changing the slider value & limits via text entry.

I'd also like to see or create a drop-down text menu, but given the difficulty in getting this to work at all (and not very prettily), I think backend-specific approaches may prove better.