[fxruby-users] FXTextField - posSelected?(pos)

Gérard Ménochet gerard.menochet at wanadoo.fr
Mon May 15 16:21:14 EDT 2006


Hi,

    I wonder if am facing a bug or something else

    On a FXtextField, I want to detect the low and high pos of the selected string

    example: the text is:  0123456789

    The selected string is :    234567

     first = last = -1
      atext.text.length.times  do |pos|
           first = pos  if atext.posSelected?(pos) and first < 0
           last = pos  if atext.posSelected?(pos)
      end
      puts " first = #{first}    last = #{last}"

       Result:  last ==  8   !!!!!!   ===> problem , 8 is not selected

       More,    atext.posSeltected?(last) ? true : false     ===> true. In fact, it's not  selected

       If I try with 456789   (including the last character), it is ok  .....

Some clues ?

Regards


Gérard Ménochet


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/fxruby-users/attachments/20060515/ca94dbc2/attachment.htm 


More information about the fxruby-users mailing list