Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Shoes.app do
- stack do
- p=para "After pressing 'search' a question will arise"
- box=edit_box
- box.text="Onenofnthenmostnstrikingndifferencesnbetweennancatnandnanlienisnthatnancatnhasnonlynnine lives."
- flow :margin_top=>0.1 do
- search=edit_line
- button("search") do
- pos=box.text.index search.text
- y = box.text[0..pos].split.size-1 if pos
- if not y.nil?
- #For example if you searched "only" then
- #cursor should jump/scroll to line 17.
- #
- #Anything there for cursor positioning,
- #like: box.cursor=[0,y]
- #
- p.text="How can I move editbox's cursor in line #{y+1}?"
- else
- alert "'#{search.text}' not found"
- end
- end
- end
- end
- end
- rb_define_method(cEditBox, "text", CASTHOOK(shoes_edit_box_get_text), 0);
- rb_define_method(cEditBox, "text=", CASTHOOK(shoes_edit_box_set_text), 1);
- rb_define_method(cEditBox, "draw", CASTHOOK(shoes_edit_box_draw), 2);
- rb_define_method(cEditBox, "change", CASTHOOK(shoes_control_change), -1);
Add Comment
Please, Sign In to add comment