Can’t get this function working, does any body know where I’m wrong ?
@term = Wx::TextCtrl.new(@skin, -1, ‘Paste URL Here’, :pos => [25,100],
:size => [300,20]) #, :style => Wx::NO_BORDER)
@term.evt_set_focus() {|event| on_term_focus(event) }
def on_term_focus(event)
if @term.get_value == “Paste URL Here”
@term.set_value("")
else
@term.set_selection(-1,-1) #<---- DON’T WORK
end
end
try to skip:
def on_term_focus(event)
if @term.get_value == “Paste URL Here”
@term.set_value("")
else
@term.set_selection(-1,-1)
end
evt.skip()
end
hth
bio.
Fabio P. wrote:
sorry event.skip()
Unfortunately it didn’t help
@term.set_selection(-1,-1) #<---- DON'T WORK
Hi Rob,
I have the same problem with a ListCtrl Object,
and the solution for me is to REFRESH the ListCtrl after the selection:
ListCtrl#set_item_state( )
ListCtrl#refresh_items( )
I hope it helps
FELIPE