[Fxruby-users] FXList#makeItemVisible and ruby threads
Status: Inactive
Brought to you by:
lyle
|
From: Joel V. <vj...@PA...> - 2003-12-21 22:07:15
|
I'm updating a FXList from a thread, and I'd like to
always scroll to the last item. This is what I tried:
require 'fox'
include Fox
app = FXApp.new("List", "TEST")
win = FXMainWindow.new(app, "list")
list = FXList.new(win, 10)
Thread.new do
20.times do |i|
list << i.to_s
# sleep 0.1
list.makeItemVisible(list.numItems-1) # no effect
sleep 0.1
end
end
win.show
app.create
app.run
As it is, the makeItemVisible has no effect, immediate or delayed.
However, if I uncomment the first sleep, it has an immediate effect, as
desired.
Does that make sense?
|