[Fxruby-users] makePositionVisible() fails in FXList, FXTreeList
Status: Inactive
Brought to you by:
lyle
|
From: David L H. <Dav...@co...> - 2004-03-08 04:30:09
|
Hi,
I'm new to Ruby, Fox and this list. Am enjoying both Ruby and FXRuby,
although I'm having trouble figuring out how to do things. My application
is sort of like an RS-232 terminal (similar to Procomm). I'm using the
SerialPort module, which more or less works. It fails with addInput() -
the callback is called immediatly which causes a few problems to say the
least. Using addTimeout is a work around for now.
My big problem now is that I can't seem to get makePositionVisible() to
work in both in FXList and FXTreeList. I've tried the index and item
version in FXList, item in FXTreeList. In both cases, the list scrolls to
the first element in the list. I can use FXText to display my data, and
there makePositionVisible() works. However, I'd rather have lines as
items...
I'm trying to log events in the lists, and would like the list to scroll
up to display the most recent.
my append code looks like this:
if USE_TREE
item= @cmdOutput.addItemLast(nil, text)
@cmdOutput.makeItemVisible(item) # list scrolls to first item
elsif USE_TXT_LIST
ix= @cmdOutput.appendItem(item= FXListItem.new(text))
@cmdOutput.makeItemVisible(item) # list scrolls to first item
OR
@cmdOutput.makeItemVisible(ix) # list scrolls to first item
else
@cmdOutput.appendText(text)
@cmdOutput.makePositionVisible(@cmdOutput.text.length) # srolls to
put last line at bottom where I want
end
Any ideas?
|