Re: [Fxruby-users] Usage FXList : makeItemVisible
Status: Inactive
Brought to you by:
lyle
|
From: SIMOKAWA h. <h-s...@aa...> - 2003-10-22 16:59:25
|
Hello all.
Thanks for Dalibor Sramek and meinrad recheis.
I have confirmed that the 'makeItemVisible' works after 'show'.
Another Question:
The 'makeItemVisible' is not working just after 'clearItems'.
A 'create' is need before 'makeItemVisible'.
But when not just after, the 'create' is needless.
Below is my code.
If you delete line#2, btnV9 is not work.
If you delete line#1 and #2, btnV9 is work after pushing btnUp.
Thanks for the help in advance
SIMOKAWA, hajime (male,japan)
require 'fox'
include Fox
class ListTestWindow < FXMainWindow
def initialize(app)
super(app, "fxtest", nil, nil, DECOR_ALL, 0, 0, 100)
@btnV0 = FXButton.new(self,'visible 0',nil,nil,0,BUTTON_NORMAL |LAYOUT_FILL_X)
@lst = FXList.new(self,4,nil,0,LIST_NORMAL |LAYOUT_FILL_X)
@btnV9 = FXButton.new(self,'visible 9',nil,nil,0,BUTTON_NORMAL |LAYOUT_FILL_X)
@btnUp = FXButton.new(self,'update',nil,nil,0,BUTTON_NORMAL |LAYOUT_FILL_X)
self.update_list
@btnV0.connect(SEL_COMMAND){
@lst.makeItemVisible 0
}
@btnV9.connect(SEL_COMMAND){
update_list #1 when 'update' put here,
create #2 'create' must be after update
@lst.makeItemVisible 9
}
@btnUp.connect(SEL_COMMAND){
update_list; #3 'create' is needless
}
end
def update_list
@lst.clearItems
@lst.appendItem '0'
@lst.appendItem '1'
@lst.appendItem '2'
@lst.appendItem '3'
@lst.appendItem '4'
@lst.appendItem '5'
@lst.appendItem '6'
@lst.appendItem '7'
@lst.appendItem '8'
@lst.appendItem '9'
end
def create
super
show(PLACEMENT_SCREEN)
end
end
if __FILE__ == $0
app = FXApp.new("FoxTest", "FoxTest")
ListTestWindow.new(app)
app.create
app.run
end
|