Skip to content
Andrej Vodopivec edited this page Mar 16, 2015 · 1 revision

notebook and panedwindow can be used to manage other windows. Windows which have notebook or panedwindow as a parent are not positioned using a geometry manager.

Exaple:

Containers

(defpackage :tk-user
  (:use :cl :tk)
  (:export :main))

(in-package :tk-user)

(defun main ()
  (with-tk-root (root)
    (setf (window-title root) "Containers")
    (setf (window-minsize root) '(400 400))

    (let* ((nb (notebook :parent root))
           (pw1 (panedwindow :parent nb :orient "vertical"))
           (pw2 (panedwindow :parent nb :orient "horizontal")))

      (notebook-add nb pw1 :text "Vertical")
      (notebook-add nb pw2 :text "Horizontal")

      (panedwindow-add pw1 (label :parent pw1 :text "1" :relief "sunken" :anchor "center")
                       :weight 1)
      (panedwindow-add pw1 (label :parent pw1 :text "2" :relief "sunken" :anchor "center")
                       :weight 3)

      (panedwindow-add pw2 (label :parent pw2 :text "A" :relief "sunken" :anchor "center")
                       :weight 3)
      (panedwindow-add pw2 (label :parent pw2 :text "B" :relief "sunken" :anchor "center")
                       :weight 1)

      (pack nb :expand t :fill "both"))))

Functions for notebooks:

  • (notebook-add nb w &rest options)
  • (notebook-forget nb tid)
  • (notebook-hide nb tid)
  • (notebook-identify-tab nb x y)
  • (notebook-index nb tid)
  • (notebook-insert nb pos subw)
  • (notebook-select nb)
  • (notebook-tab nb tid &rest options)
  • (notebook-tabs nb)

Functions for panedwindows:

  • (panedwindow-add pw w &rest options)
  • (panedwindow-forget pw pid)
  • (panedwindow-identify-sash pw x y)
  • (panedwindow-insert pw pos subw)
  • (panedwindow-pane pw pid &rest options)
  • (panedwindow-panes pw)
  • (panedwindow-sashpos pw ind)

Tcl/Tk documentation for notebook.

Tcl/Tk documentation for panedwindow.

Clone this wiki locally