[fxruby-users] FXTextField

Jeroen van der Zijp jeroen at fox-toolkit.org
Tue Jan 24 13:24:24 EST 2006


On Tuesday 24 January 2006 12:05 pm, Lyle Johnson wrote:
> 
> On Jan 24, 2006, at 9:41 AM, Uwe Hartl wrote:
> 
> > this is setting the text just right away. The point here is, that I 
> > want the
> > text to be added at the position of the cursor. If I have "qwerty" in 
> > the
> > text field and I put the cursor behind the "e" that I calll the method 
> > with
> > "asdfg" I want the result to be "qweasdfgrty". This is what I thought 
> > the
> > INSERT would do.
> 
> Ah, OK. I have added this to the bug list and will try to get it fixed 
> for the next release. I am actually surprised to see that Jeroen 
> doesn't provide an API to (more directly) insert text into a text field 
> as you can with the multiline FXText widget.

Its not there because text fields usually contain only a little text.

Note that manipulation of strings is in FXString.

So:

	field->setText(field->getText().insert(pos,"More text"));


Should do the trick.  I admit it is slightly more work, but up till now
no one has never needed a specific API to do just this in FXTextField....



		- Jeroen


More information about the fxruby-users mailing list