Re: [Fxruby-users] Usage FXList : makeItemVisible
Status: Inactive
Brought to you by:
lyle
From: SIMOKAWA h. <h-s...@aa...> - 2003-10-23 06:32:59
|
Hello all, and thanks for all. I understand and the 'makeItemVisible' is working very well. Lyle Johnson <jl...@cf...> wrote: > SIMOKAWA hajime wrote: > > > Another Question: > > The 'makeItemVisible' is not working just after 'clearItems'. > > A 'create' is need before 'makeItemVisible'. > > When you call clearItems() and, subsequently appendItem(), on the list, > the list's layout is marked as dirty but it is not immediately > reconciled. FOX uses a technique of delayed layout, which is described > on this page from the FOX documentation: > > http://www.fox-toolkit.org/guiupdate.html > > Under normal circumstances, the GUI layout will not actually be > reconciled until we return to the main FOX event loop, i.e. until we > exit the callback for @btnV9. The problem in your case is that > makeItemVisible() assumes that the list's layout has already been > reconciled, which it hasn't. So the solution is to do *something* to > force the layout to be reconciled immediately, before the call to > makeItemVisible(). Calling create() on the main window is one way to do > this, but the more proper way is to call the FXApp#forceRefesh method: > > @btnV9.connect(SEL_COMMAND) { > update_list > app.forceRefresh # reconcile layout immediately! > @lst.makeItemVisible 9 > } > > > But when not just after, the 'create' is needless. > > Correct. In this case, the calls to clearItems() and appendItem() in > @btnUp's callback: > > @btnUp.connect(SEL_COMMAND) { > update_list > } > > Mark the list's layout as dirty, and shortly after we re-enter FOX's > main event loop, the GUI layout is reconciled. Now any subsequent call > to makeItemVisible() will work properly. > > Hope this helps, > > Lyle > > > > ------------------------------------------------------- > This SF.net email is sponsored by OSDN developer relations > Here's your chance to show off your extensive product knowledge > We want to know what you know. Tell us and you have a chance to win $100 > http://www.zoomerang.com/survey.zgi?HRPT1X3RYQNC5V4MLNSV3E54 > _______________________________________________ > Fxruby-users mailing list > Fxr...@li... > https://lists.sourceforge.net/lists/listinfo/fxruby-users ┏┏┏┏┏┏┏┏┏┏┏┏┏┏┏┏┏┏┏┏┏┏┏┏┏┏┏┏┏┏┏┏┏┏┏┏┏┏ 下川 肇 (しもかわ はじめ)mailto:h-simokawa@aandd.co.jp 株式会社 エー・アンド・デイ 設計開発本部 132課 住所 埼玉県北本市朝日1−243 (郵便番号 364−8585) 電話 048-593−1827(132課直通) FAX 048-593−1119 ┏┏┏┏┏┏┏┏┏┏┏┏┏┏┏┏┏┏┏┏┏┏┏┏┏┏┏┏┏┏┏┏┏┏┏┏┏┏ |