def putch char
       _maxlen = @maxlen || @width - @internal_width
      @buffer ||= @list[@current_index]
      return -1 if !@editable #or @buffer.length >= _maxlen
      #if @chars_allowed != nil # remove useless functionality
        #return if char.match(@chars_allowed).nil?
      #end
      raise "putch expects only one char" if char.length != 1
      oldcurpos = @curpos
      #$log.debug "putch : pr:#{@current_index}, cp:#{@curpos}, char:#{char}, lc:#{@buffer[-1]}, buf:(#{@buffer})"
      if @overwrite_mode
        @buffer[@curpos] = char
      else
        @buffer.insert(@curpos, char)
      end
      @curpos += 1 
      #$log.debug "putch INS: cp:#{@curpos}, max:#{_maxlen}, buf:(#{@buffer.length})"
      if @curpos-1 > _maxlen or @buffer.length()-1 > _maxlen
        lastchars, lastspace = push_last_word @current_index
        #$log.debug "last sapce #{lastspace}, lastchars:#{lastchars},lc:#{lastchars[-1]}, #{@list[@current_index]} "
        ## wrap on word XX If last char is 10 then insert line
        @buffer = @list[@current_index]
        if @curpos-1 > _maxlen  or @curpos-1 > @buffer.length()-1
          ret = down 
          # keep the cursor in the same position in the string that was pushed down.
          @curpos = oldcurpos - lastspace  #lastchars.length # 0
        end
      end
      set_form_row
      @buffer = @list[@current_index]
      set_form_col
      @modified = true
      fire_handler :CHANGE, InputDataEvent.new(oldcurpos,@curpos, self, :INSERT, @current_index, char)     #  2008-12-24 18:34 
      @repaint_required = true
      0
    end
def putch char
       _maxlen = @maxlen || @width - @internal_width
      @buffer ||= @list[@current_index]
      return -1 if !@editable #or @buffer.length >= _maxlen
      #if @chars_allowed != nil # remove useless functionality
        #return if char.match(@chars_allowed).nil?
      #end
      raise "putch expects only one char" if char.length != 1
      oldcurpos = @curpos
      #$log.debug "putch : pr:#{@current_index}, cp:#{@curpos}, char:#{char}, lc:#{@buffer[-1]}, buf:(#{@buffer})"
      if @overwrite_mode
        @buffer[@curpos] = char
      else
        @buffer.insert(@curpos, char)
      end
      @curpos += 1 
      #$log.debug "putch INS: cp:#{@curpos}, max:#{_maxlen}, buf:(#{@buffer.length})"
      if @curpos-1 > _maxlen or @buffer.length()-1 > _maxlen
        lastchars, lastspace = push_last_word @current_index
        #$log.debug "last sapce #{lastspace}, lastchars:#{lastchars},lc:#{lastchars[-1]}, #{@list[@current_index]} "
        ## wrap on word XX If last char is 10 then insert line
        @buffer = @list[@current_index]
        if @curpos-1 > _maxlen  or @curpos-1 > @buffer.length()-1
          ret = down 
          # keep the cursor in the same position in the string that was pushed down.
          @curpos = oldcurpos - lastspace  #lastchars.length # 0
        end
      end
      set_form_row
      @buffer = @list[@current_index]
      set_form_col
      @modified = true
      fire_handler :CHANGE, InputDataEvent.new(oldcurpos,@curpos, self, :INSERT, @current_index, char)     #  2008-12-24 18:34 
      @repaint_required = true
      0
    end
add one char. careful, i shoved a string in yesterday.