Tk Source Code

Artifact [50c9569c]
Login

Artifact 50c9569c7c0b0ce8d763b3a1b4736d85f995070553342d074e662b27aca341b9:

Attachment "bugdemo0.tcl" to ticket [b086bb1d] added by jal_frezie 2026-06-22 12:53:24.
package require Tk

wm title . "Notebook and Paned Windows"

ttk::notebook .nb
pack .nb -fill both -expand 1

# First tab
ttk::frame .nb.tab1
.nb add .nb.tab1 -text "Workspace"

# Second tab
ttk::frame .nb.tab2
.nb add .nb.tab2 -text "Settings"

# Main vertical panedwindow in tab 1
ttk::panedwindow .nb.tab1.pw -orient vertical
pack .nb.tab1.pw -fill both -expand 1

# Left side of the vertical split
ttk::panedwindow .nb.tab1.pw.left -orient horizontal

# Right side of the vertical split
ttk::panedwindow .nb.tab1.pw.right -orient horizontal

# Add left and right panes to the vertical panedwindow
.nb.tab1.pw add .nb.tab1.pw.left
.nb.tab1.pw add .nb.tab1.pw.right

# Left side horizontal split
ttk::frame .nb.tab1.pw.left.topl
ttk::frame .nb.tab1.pw.left.bottoml
.nb.tab1.pw.left add .nb.tab1.pw.left.topl
.nb.tab1.pw.left add .nb.tab1.pw.left.bottoml

# Right side horizontal split
ttk::frame .nb.tab1.pw.right.topr
ttk::frame .nb.tab1.pw.right.bottomr
.nb.tab1.pw.right add .nb.tab1.pw.right.topr
.nb.tab1.pw.right add .nb.tab1.pw.right.bottomr

# Simple content for each pane
ttk::label .nb.tab1.pw.left.topl.lbl -text "Left Top"
ttk::label .nb.tab1.pw.left.bottoml.lbl -text "Left Bottom"
ttk::label .nb.tab1.pw.right.topr.lbl -text "Right Top"
ttk::label .nb.tab1.pw.right.bottomr.lbl -text "Right Bottom"

pack .nb.tab1.pw.left.topl.lbl -expand 1
pack .nb.tab1.pw.left.bottoml.lbl -expand 1
pack .nb.tab1.pw.right.topr.lbl -expand 1
pack .nb.tab1.pw.right.bottomr.lbl -expand 1

# Some content for the second tab
ttk::label .nb.tab2.msg -text "Second tab content goes here."
pack .nb.tab2.msg -padx 20 -pady 20
ttk::style configure TPanedwindow -background gray75

wm geometry . 400x400
update idletasks
.nb.tab1.pw.left sashpos 0 200
.nb.tab1.pw.right sashpos 0 200
.nb.tab1.pw sashpos 0 200