\documentclass[]{article}
\usepackage{amsmath,graphicx,supertabular,hyperref,tabularx,ifthen}
\title{TIP \#177: Add -stretch Option to panedwindow Widget}
\date{March 17, 2004}
\author{Brian Griffin}
\urlstyle{sf}
\setlength{\parskip}{1ex}
\setlength{\parindent}{0pt}
\def\tipversion$#1${\texttt{\$#1\$}}
\def\tiplangle#1{\ensuremath{<}}
\def\tiprangle#1{\ensuremath{>}}
\def\tipbar#1{\ensuremath{|}}
\def\tipmail#1#2{\(\langle\){\small\expandafter\url{#1@#2}}\(\rangle\)}
\ifx\pdfoutput\undefined
\newcommand{\tipimage}[2]{\typeout{Make sure you download #1.eps}\ifthenelse{\lengthtest{0.8\textwidth>#2}\and\lengthtest{0pt<#2}}{\includegraphics{#1.eps}}{\includegraphics[width=0.8\textwidth]{#1.eps}}}
\newcommand{\tipxref}[1]{}
\newcommand{\tipxrefend}{}
\else
\newcommand{\tipimage}[2]{\typeout{Make sure you create #1.pdf}\ifthenelse{\lengthtest{0.8\textwidth>#2}\and\lengthtest{0pt<#2}}{\includegraphics{#1.pdf}}{\includegraphics[width=0.8\textwidth]{#1.pdf}}}
\pdfcatalog{/PageMode /UseOutlines}
\newcommand{\tipxref}[1]{\pdfannotlink attr {/C [0.5 0.5 1.0] /Border [0 0 1]} goto name {#1}}
\newcommand{\tipxrefend}{\pdfendlink}
\fi
\newenvironment{tipabstract}{\begin{abstract}}{\end{abstract}}
\begin{document}\maketitle
\begin{center}\begin{tabularx}{\linewidth}{|r@{: }X|}\hline
\textbf{TIP \#177}&\textbf{Add -stretch Option to panedwindow Widget}\\\hline
Author&

Brian Griffin \tipmail{bgriffin}{model.com}
\\
Created&Wednesday, \(\text{17}^{\text{th}}\) March 2004\\
Type&Project\\
Tcl Version&\(8.5\)\\
State&Final\\
Vote&Done\\
Version&\tipversion$Revision: 1.5 $\\
Keywords&Tk\\
Post History&\\
\hline\end{tabularx}\end{center}
\thispagestyle{empty}\pagestyle{empty}
\begin{tipabstract}

This TIP proposes adding a \textbf{paneconfigure} option to \textbf{panedwindow}s that will allow alternative fill behavior.
\end{tipabstract}
\tableofcontents\setcounter{page}{0}\clearpage\pagestyle{plain}

\section{Rationale}

The current behavior, although reasonable, is too limiting. We should give control to programmers so that they can specify the fill behavior in a way that makes sense for their application.

\section{Proposed Change}

Currently, the \textbf{panedwindow} widget gives any remaining space (or takes away space) from the last (right most or bottom most) pane only. This proposal will add a per pane configure option so that any or all panes may receive the additional space.

A \textbf{-stretch} option will be added to the paneconfigure list of options. The value will be an enumeration of ``\textbf{last}'', ``\textbf{first}'', ``\textbf{middle}'', ``\textbf{always}'', and ``\textbf{never}''. The default value will be ``\textbf{last}'' which maintains the \textbf{panedwindow}'s current behavior. The \textbf{panedwindow} will calculate the required size of all its panes. Any remaining (or deficit) space will be distributed to those panes marked for stretching. The space will be distributed based on each panes current ratio of the whole. For example, given panes \textit{a}, \textit{b}, and \textit{c}, where only \textit{b} and \textit{c} are marked for stretching and \textit{b} is 25\% of the size of (\textit{b}+\textit{c}), then \textit{b} will receive 25\% of the surplus or deficit space.

The \textbf{-stretch} enumeration values have the following meaning:
\begin{description}
\item[last]
Only if this pane is the last (right-most or bottom-most, depending on overall orientation) pane will it stretch.
\item[first]
Only if this pane is the first (left-most or top-most, depending on overall orientation) pane will it be stretch.
\item[middle]
Only if this pane is \textit{not} the first or last pane will it stretch.
\item[always]
This pane will always stretch.
\item[never]
This pane will never stretch.
\end{description}

\section{Draft Implmentation}

An implementation of this enhancement is availble [\url{ftp://ftp.model.com/pub/tcl/pw_stretch_TIP.tgz}].

\section{Copyright}

This document has been placed in the public domain.

\section{Colophon}

\textit{TIP AutoGenerator --- written by Donal K. Fellows}
\end{document}
