Re: [Fxruby-users] Usage FXList : makeItemVisible
Status: Inactive
Brought to you by:
lyle
|
From: meinrad r. <mei...@gm...> - 2003-10-21 08:22:18
|
SIMOKAWA hajime wrote:
> Hello all,
>
hi,
> I am trying to do something with FxRuby, but it is not working for me.
> I want to scroll to bring a item into view, but I cannot it.
> Below is my code.
the line
@lst.makeItemVisible 7
works well for me when inserted after show(PLACEMENT_SCREEN)
obviously this can only be used after creation of the list.
>
> Thanks for the help in advance
>
> SIMOKAWA, hajime (male,japan)
>
regards,
-- henon
>
>
> require 'fox'
> include Fox
>
> class ListTestWindow < FXMainWindow
> def initialize(app)
> super(app, "fxtest", nil, nil, DECOR_ALL, 0, 0, 100, 100)
>
> @lst = FXList.new(self,4,nil,0,LIST_NORMAL |LAYOUT_FILL_X)
> @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'
>
> @lst.makeItemVisible 7
>
> end
>
> def create
> super
> show(PLACEMENT_SCREEN)
@lst.makeItemVisible 7
> end
> end
>
> if __FILE__ == $0
> app = FXApp.new("FoxTest", "FoxTest")
> ListTestWindow.new(app)
> app.create
> app.run
> end
>
>
|