From: Ned Konz Date: 2001-09-30T05:20:31+09:00 Subject: [ruby-talk:21832] how to position cursor in gtk entry field? Thanks to the suggestion earlier re: validation, I was able to get this working (I'm using libglade and gtk+): in initialize: @entryField = @glade.getWidget("item_number_entry") handler = method(:item_number_changed).to_proc @entryFieldHandlerId = @entryField.signal_connect("insert_text", &handler) then: def item_number_changed(e, t, n) newText = t.gsub(/\D/, '') if newText.length > 0 begin e.signal_handler_block(@entryFieldHandlerId) e.insert_text(newText, n) # what to do here to move the cursor? ensure e.signal_handler_unblock(@entryFieldHandlerId) end end e.signal_emit_stop("insert_text") end Which does the validation/filtering just fine. But when it inserts the text, the cursor stays at the same place. I've tried position=, set_position, and set_selection; none of the three seemed to work. Any suggestions? -- Ned Konz currently: Stanwood, WA email: ned@bike-nomad.com homepage: http://bike-nomad.com