|
From: Joe E. <jen...@fl...> - 2006-12-14 20:58:17
|
Bug #1614361 got me to thinking about a potential improvement for how the ttk::notebook and ttk::panedwindow widgets manage their children. The current API is: $nb add $win [ ... options ... ] Manage $win as a slave and add it to the end of the list. It is an error if $win is already managed by $nb. $nb forget $tabid Unmanages $tabid; $tabid is either the widget path of a managed slave, an integer index, or one of the other syntactic forms described in "TAB IDENTIFIERS". There's also an [$nb insert ...] command, which can add tabs at a specific position or move existing tabs around. The panedwindow supports the same interface (with a couple minor differences). Proposed change: $nb remove $win Unmaps the slave window $win but leave it managed. If $win is not currently managed by $nb, do nothing. $nb add $win [... options ...] Manage $win as a slave and add it to the end of the list if it is not currently managed by $nb. Remap $win at its previous position if it is currently managed by $nb but unmapped. Do nothing if it is already mapped and managed. $nb forget $win Unmap and unmanage $win. Do nothing if $win is not currently managed by $nb. ... and the same thing for panedwindow widgets. [$nb remove $win] would do basically the same thing that [$nb tab $win -state hidden] currently does (just implemented differently); the latter could eventually be phased out. The only incompatibility would be that [$nb forget] would only take window names, not arbitrary tab identifiers. Opinions? --Joe English jen...@fl... |