I need a standard single line text entry widget
Ned Konz
ned at bike-nomad.com
Tue Apr 9 19:21:16 UTC 2002
On Tuesday 09 April 2002 11:57 am, Ken Causey wrote:
> I'm finding it hard to believe but I can't seem to find what I
> consider to be a standard single-line text entry widget as it
> exists in most widget sets.
>
> Attributes includes:
>
> Text is confined to a single line and widget does not change size
> as a result of text entry.
>
> If text continues beyond the boundary of the widget the text
> "scrolls" within the widget. This scrolling follows the text entry
> marker.
>
> There may be other attributes I'm not thinking of right now but
> those two, particularly the second seem to be difficult to come up
> with. What am I overlooking?
>
> Oh, I guess I should mention that I'm using 3.2g and would prefer a
> morphic widget.
What about PluggableTextMorph? Look at (for instance) the "search"
field in the MessageNames tool.
You can try this (lifted from MessageNames) in a Workspace:
plugTextMor _ PluggableTextMorph on: nil "your model here"
text: nil accept: nil "your model selectors here"
readSelection: nil menu: nil. "your model selectors here"
plugTextMor extent: 144 at 22.
plugTextMor setProperty: #alwaysAccept toValue: true.
plugTextMor askBeforeDiscardingEdits: false.
plugTextMor acceptOnCR: true.
plugTextMor setTextColor: Color brown.
plugTextMor vResizing: #spaceFill; hResizing: #spaceFill.
plugTextMor hideScrollBarIndefinitely.
plugTextMor setTextMorphToSelectAllOnMouseEnter.
plugTextMor openInHand.
Of course, you can play with the selection preferences, etc.
--
Ned Konz
http://bike-nomad.com
GPG key ID: BEEA7EFE
More information about the Squeak-dev
mailing list
|