Docking framework v2.0

The Docking framework v2.0 is a tool to create the paned GUI.

It is an enhanced version of Docking framework, the diamond in need of cutting.

The main cuttings of Docking framework v2.0 are

  • the resulting layout is put out to a file, along with stdout as in Docking framework
  • the resulting layout file is made usable, integrated with Docking framework v2.0
  • another resulting file is for apave package, even more usable
  • ttk::frame used instead of label as container widget for ttk::notebook tabs
  • ttk::panedwindow added at bottom, to allow resizing the bottom parts
  • tabs' number is 10 instead of 8, the option is easily customized
  • .dFW for toplevel path instead of .t1 being too generic
  • some unused code is removed
  • the mouse right button allows removing tabs from the layout
  • Help button
  • demo video shows Docking framework v2.0 in work
  • messages at saving/restoring layouts
  • correct saving/restoring layout geometry

The last point should be detailed, as it might be interesting for those interested.

The main problem is the layouts with multiple ttk::notebook tabs in a ttk::panedwindow.

With such layouts, you should use a selected tab's sizes to save/restore the ttk::panedwindow's sizes. Otherwise, the latter would be distorted.

In a pseudo code, it might look as follows.

At saving:

for {set i 0} {$i<$number_of_tabs} {incr i} {
  set frame [path_to_tab's_frame $i]
  set notebook [container_of_the_frame $frame]
  if {$notebook ne {} && [$notebook select] eq $frame} {
    set width [winfo width $frame]
    set height [winfo height $frame]
    save_sizes_of_frame $frame $width $height
  }
}

At restoring:

for {set i 0} {$i<$number_of_tabs} {incr i} {
  set frame [path_to_tab's_frame $i]
  lassign [frame_saved_sizes $frame] width height
  if {[string is digit -strict $width] && [string is digit -strict $height]} {
    $frame configure -width $width -height $height
  }
}

How to use

The usage of Docking framework v2.0 is straightforward:

   tclsh dockingFW.tcl

More details are in the framework's README.md .

As for visual effects, the usage is rather detailed in the demo video .

Links

DockingFW-2.0