source: trunk/test/buggy_xmls/disabledtabs/readme @ 1216

Last change on this file since 1216 was 1216, checked in by dkearney, 16 years ago

adding fix to controls.tcl to properly display all enabled tabs when some of the available tabs are disabled. this fix helps allow photonicsdb to dynamically display inputs for layers of materials while keeping the first and last tabs always enabled.

also included is an example which displays the bad behavior in previous versions of rappture as part of the buggy_xml series.

File size: 1.3 KB
1This is an example from Satoshi Ishii working on PhotonicsDB. He was trying
2to setup tabs in the gui by using groups of groups. He wanted the first and
3last tab to always be enabled. The tabs in between the first and last
4contained enable tests.
6Rappture was able to successfully create the tabs, but the last tab always
7contained data from the first disabled tab. The cause of this problem is that
8gui/scripts/control.tcl, which is in charge of setting up the tabs, gets an
9index of which tab was selected and uses this index to access the name and
10value of the tab to be shown. The index is used in a list which contains all
11possible tabs, not a list that contains only the enabled tabs. The result is
12that when we have a list containing five total tabs numbered 1-5, and tabs
131,2, and 5 are enabled, an index of 3 would choose a disabled tab to show.
15This problem was solved by adding an additional private variable to the
16controls object that keeps track of which tabs are enabled and shown. We now
17index into the _showing list instead of the _controls list. In the example
18above the _showing list would contain tabs 1, 2 and 5. When the last tab was
19chosen in the graphical user interface, _changeTabs function would receive
20an index of 3 referencing tab 5 and the correct tab would be displayed to the
Note: See TracBrowser for help on using the repository browser.