summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog14
-rw-r--r--doc/bind.n59
-rw-r--r--doc/text.n203
-rw-r--r--library/demos/widget266
-rw-r--r--library/ttk/winTheme.tcl62
-rw-r--r--library/ttk/xpTheme.tcl49
-rw-r--r--win/makefile.vc109
7 files changed, 383 insertions, 379 deletions
diff --git a/ChangeLog b/ChangeLog
index 007b927..bd003a6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2007-10-16 David Gravereaux <davygrvy@pobox.com>
+
+ * win/makefile.vc: depend target now works and builds a generated
+ dependency list with $(TCLTOOLSDIR)/mkdepend.tcl
+
+2007-10-16 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
+
+ * library/demos/widget: Made the code for generating the contents of
+ the main widget more informative. Added 'new' flagging for wholly new
+ demos.
+
+ * doc/text.n: Made it clearer what things are text widget invokations
+ and what are not. Also some other clarity improvements.
+
2007-10-15 Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
* library/demos/widget: Use Ttk widgets for the widget demo core, for
diff --git a/doc/bind.n b/doc/bind.n
index c169512..6bf6066 100644
--- a/doc/bind.n
+++ b/doc/bind.n
@@ -6,7 +6,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: bind.n,v 1.20 2006/11/15 13:29:17 dkf Exp $
+'\" RCS: @(#) $Id: bind.n,v 1.20.2.1 2007/10/17 14:37:05 dgp Exp $
'\"
.so man.macros
.TH bind n 8.0 Tk "Tk Built-In Commands"
@@ -94,7 +94,7 @@ Modifiers, such as \fBShift\fR or \fBControl\fR, may not be combined with a
virtual event to modify it. Bindings on a virtual event may be created
before the virtual event is defined, and if the definition of a virtual
event changes dynamically, all windows bound to that virtual event will
-respond immediately to the new definition.
+respond immediately to the new definition.
.PP
Some widgets (e.g. \fBmenu\fR and \fBtext\fR) issue virtual events
when their internal state is updated in some ways. Please see the
@@ -105,9 +105,9 @@ Modifiers consist of any of the following values:
.DS
.ta 6c
\fBControl\fR \fBMod2, M2\fR
-\fBShift\fR \fBMod3, M3\fR
+\fBShift\fR \fBMod3, M3\fR
\fBLock\fR \fBMod4, M4\fR
-\fBButton1, B1\fR \fBMod5, M5\fR
+\fBButton1, B1\fR \fBMod5, M5\fR
\fBButton2, B2\fR \fBMeta, M\fR
\fBButton3, B3\fR \fBAlt\fR
\fBButton4, B4\fR \fBDouble\fR
@@ -170,7 +170,7 @@ types; where two names appear together, they are synonyms.
\fBActivate Destroy Map
ButtonPress, Button Enter MapRequest
ButtonRelease Expose Motion
-Circulate FocusIn MouseWheel
+Circulate FocusIn MouseWheel
CirculateRequest FocusOut Property
Colormap Gravity Reparent
Configure KeyPress, Key ResizeRequest
@@ -217,13 +217,13 @@ events are sent to the window which currently has the keyboard focus.
The \fBButtonPress\fR and \fBButtonRelease\fR events
are generated when the user presses or releases a mouse button.
\fBMotion\fR events are generated whenever the pointer is moved.
-\fBButtonPress\fR, \fBButtonRelease\fR, and \fBMotion\fR events are
+\fBButtonPress\fR, \fBButtonRelease\fR, and \fBMotion\fR events are
normally sent to the window containing the pointer.
.RS
.PP
When a mouse button is pressed, the window containing the pointer
automatically obtains a temporary pointer grab.
-Subsequent \fBButtonPress\fR, \fBButtonRelease\fR, and \fBMotion\fR
+Subsequent \fBButtonPress\fR, \fBButtonRelease\fR, and \fBMotion\fR
events will be sent to that window,
regardless of which window contains the pointer,
until all buttons have been released.
@@ -245,7 +245,7 @@ Other windows become mapped when they are placed under control
of a geometry manager (for example \fBpack\fR or \fBgrid\fR).
.PP
A window is \fIviewable\fR only if it and all of its ancestors are mapped.
-Note that geometry managers typically do not map their children until
+Note that geometry managers typically do not map their children until
they have been mapped themselves, and unmap all children
when they become unmapped; hence in Tk \fBMap\fR and \fBUnmap\fR
events indicate whether or not a window is viewable.
@@ -260,10 +260,10 @@ specifies the new state.
An \fBExpose\fR event is generated whenever all or part of a
window should be redrawn (for example, when a window is
first mapped or if it becomes unobscured).
-It is normally not necessary for client applications to
+It is normally not necessary for client applications to
handle \fBExpose\fR events, since Tk handles them internally.
.IP \fBDestroy\fR 5
-A \fBDestroy\fR event is delivered to a window when
+A \fBDestroy\fR event is delivered to a window when
it is destroyed.
.RS
.PP
@@ -284,16 +284,16 @@ if the old and new focus windows do not share a common parent,
windows in the hierarchy.
Thus a \fBFocusIn\fR event indicates
that the target window or one of its descendants has acquired the focus,
-and a \fBFocusOut\fR event indicates that the focus
+and a \fBFocusOut\fR event indicates that the focus
has been changed to a window outside the target window's hierarchy.
.PP
The keyboard focus may be changed explicitly by a call to \fBfocus\fR,
-or implicitly by the window manager.
+or implicitly by the window manager.
.RE
.IP "\fBEnter\fR, \fBLeave\fR" 5
An \fBEnter\fR event is sent to a window when the pointer
enters that window, and a \fBLeave\fR event is sent when
-the pointer leaves it.
+the pointer leaves it.
.RS
.PP
If there is a pointer grab in effect, \fBEnter\fR and \fBLeave\fR
@@ -453,8 +453,8 @@ For events other than these, the substituted string is undefined.
.RE
.IP \fB%f\fR 5
The \fIfocus\fR field from the event (\fB0\fR or \fB1\fR). Valid only
-for \fBEnter\fR and \fBLeave\fR events. \fB1\fR if the receiving
-window is the focus window or a descendant of the focus window,
+for \fBEnter\fR and \fBLeave\fR events. \fB1\fR if the receiving
+window is the focus window or a descendant of the focus window,
\fB0\fR otherwise.
.IP \fB%h\fR 5
The \fIheight\fR field from the event. Valid for the \fBConfigure\fR,
@@ -494,7 +494,7 @@ the property has been removed).
The \fItime\fR field from the event.
This is the X server timestamp (typically the time since
the last server reset) in milliseconds, when the event occurred.
-Valid for most events.
+Valid for most events.
.IP \fB%w\fR 5
The \fIwidth\fR field from the event.
Indicates the new or requested width of the window.
@@ -503,11 +503,11 @@ Valid only for
\fBResizeRequest\fR, and \fBExpose\fR events.
.IP "\fB%x\fR, \fB%y\fR" 5
The \fIx\fR and \fIy\fR fields from the event.
-For \fBButtonPress\fR, \fBButtonRelease\fR, \fBMotion\fR,
+For \fBButtonPress\fR, \fBButtonRelease\fR, \fBMotion\fR,
\fBKeyPress\fR, \fBKeyRelease\fR, and \fBMouseWheel\fR events,
\fB%x\fR and \fB%y\fR indicate the position of the mouse pointer
relative to the receiving window.
-For \fBEnter\fR and \fBLeave\fR events, the position where the
+For \fBEnter\fR and \fBLeave\fR events, the position where the
mouse pointer crossed the window, relative to the receiving window.
For \fBConfigure\fR and \fBCreate\fR requests, the \fIx\fR and \fIy\fR
coordinates of the window relative to its parent window.
@@ -554,22 +554,15 @@ The \fItype\fR field from the event. Valid for all event types.
.IP \fB%W\fR 5
The path name of the window to which the event was reported (the
\fIwindow\fR field from the event). Valid for all event types.
-.IP \fB%X\fR 5
-The \fIx_root\fR field from the event.
+.IP "\fB%X\fR, \fB%Y\fR" 5
+The \fIx_root\fR and \fIy_root\fR fields from the event.
If a virtual-root window manager is being used then the substituted
-value is the corresponding x-coordinate in the virtual root.
+values are the corresponding x-coordinate and y-coordinate in the virtual root.
Valid only for
\fBButtonPress\fR, \fBButtonRelease\fR, \fBKeyPress\fR, \fBKeyRelease\fR,
and \fBMotion\fR events.
-Same meaning as \fB%x\fR, except relative to the (virtual) root window.
-.IP \fB%Y\fR 5
-The \fIy_root\fR field from the event.
-If a virtual-root window manager is being used then the substituted
-value is the corresponding y-coordinate in the virtual root.
-Valid only for
-\fBButtonPress\fR, \fBButtonRelease\fR, \fBKeyPress\fR, \fBKeyRelease\fR,
-and \fBMotion\fR events.
-Same meaning as \fB%y\fR, except relative to the (virtual) root window.
+Same meaning as \fB%x\fR and \fB%y\fR, except relative to the (virtual) root
+window.
.LP
The replacement string for a %-replacement is formatted as a proper
Tcl list element.
@@ -629,9 +622,9 @@ of events matched) is more specific than a shorter sequence;
modifiers in another pattern, then the pattern with more modifiers
is more specific.
(d) a virtual event whose physical pattern matches the sequence is less
-specific than the same physical pattern that is not associated with a
+specific than the same physical pattern that is not associated with a
virtual event.
-(e) given a sequence that matches two or more virtual events, one
+(e) given a sequence that matches two or more virtual events, one
of the virtual events will be chosen, but the order is undefined.
.PP
If the matching sequences contain more than one event, then tests
@@ -642,7 +635,7 @@ most recently registered sequence is the winner.
If there are two (or more) virtual events that are both triggered by the
same sequence, and both of those virtual events are bound to the same window
tag, then only one of the virtual events will be triggered, and it will
-be picked at random:
+be picked at random:
.CS
event add <<Paste>> <Control-y>
event add <<Paste>> <Button-2>
diff --git a/doc/text.n b/doc/text.n
index f2cc083..575a673 100644
--- a/doc/text.n
+++ b/doc/text.n
@@ -5,7 +5,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: text.n,v 1.43 2006/11/15 13:29:17 dkf Exp $
+'\" RCS: @(#) $Id: text.n,v 1.43.2.1 2007/10/17 14:37:05 dgp Exp $
'\"
.so man.macros
.TH text n 8.5 Tk "Tk Built-In Commands"
@@ -36,8 +36,8 @@ inserted in the undo stack. Only meaningful when the \fB\-undo\fR
option is true.
.OP \-blockcursor blockCursor BlockCursor
.VS 8.5
-Specifies a boolean that says whether the blinking insertion cursor
-should be drawn as a character-sized rectangular block. If false
+Specifies a boolean that says whether the blinking insertion cursor
+should be drawn as a character-sized rectangular block. If false
(the default) a thin vertical line is used for the insertion cursor.
.VE 8.5
.OP \-endline endLine EndLine
@@ -114,21 +114,21 @@ following the tab character is positioned at the tab position, and
at the tab position; if there is no decimal point then the least
significant digit of the number is positioned just to the left of the
tab position; if there is no number in the text then the text is
-right-justified at the tab position.
+right-justified at the tab position.
For example, \fB\-tabs {2c left 4c 6c center}\fR creates three
tab stops at two-centimeter intervals; the first two use left
-justification and the third uses center justification.
+justification and the third uses center justification.
If the list of tab stops does not have enough elements to cover all
of the tabs in a text line, then Tk extrapolates new tab stops using
the spacing and alignment from the last tab stop in the list. Tab
-distances must be strictly positive, and must always increase from one
+distances must be strictly positive, and must always increase from one
tab stop to the next (if not, an error is thrown).
The value of the \fBtabs\fR option may be overridden by \fB\-tabs\fR
options in tags.
If no \fB\-tabs\fR option is specified, or if it is specified as
an empty list, then Tk uses default tabs spaced every eight
(average size) characters. To achieve a different standard spacing,
-for example every 4 characters, simply configure the widget with
+for example every 4 characters, simply configure the widget with
\fB\-tabs "[expr {4 * [font measure $font 0]}] left" -tabstyle wordprocessor\fR.
.OP \-tabstyle tabStyle TabStyle
Specifies how to interpret the relationship between tab stops on a line
@@ -379,8 +379,8 @@ lines are not wrapped, then these two methods of counting are equivalent.
.TP
?\fIsubmodifier\fR? \fBlinestart\fR
.VS 8.5
-Adjust the index to refer to the first index on the line. If the
-\fBdisplay\fR submodifier is given, this is the first index on the
+Adjust the index to refer to the first index on the line. If the
+\fBdisplay\fR submodifier is given, this is the first index on the
display line, otherwise on the logical line.
.VE 8.5
.TP
@@ -415,8 +415,8 @@ refers to the next-to-last character in the text and
``\fBinsert wordstart \- 1 c\fR'' refers to the character just before
the first one in the word containing the insertion cursor. Modifiers
are applied one by one in this left to right order, and after each step
-the resulting index is constrained to be a valid index in the text
-widget. So, for example, the index ``\fB1.0 -1c +1c\fR'' refers to the
+the resulting index is constrained to be a valid index in the text
+widget. So, for example, the index ``\fB1.0 -1c +1c\fR'' refers to the
index ``\fB2.0\fR''.
.PP
Where modifiers result in index changes by display lines, display chars
@@ -452,7 +452,7 @@ widget commands.
Tags serve three purposes in text widgets.
First, they control the way information is displayed on the screen.
By default, characters are displayed as determined by the
-\fBbackground\fR, \fBfont\fR, and \fBforeground\fR options for the
+\fB\-background\fR, \fB\-font\fR, and \fB\-foreground\fR options for the
text widget.
However, display options may be associated with individual tags
using the ``\fIpathName \fBtag configure\fR'' widget command.
@@ -482,7 +482,7 @@ option to give a 3-D appearance to the background for characters;
it is ignored unless the \fB\-background\fR option
has been set for the tag.
.TP
-\fB\-elide \fIboolean\fR
+\fB\-elide \fIboolean\fR
\fIElide\fR specifies whether the data should
be elided. Elided data (characters, images, embedded windows, etc) is
not displayed and takes no space on screen, but further on behaves just
@@ -598,11 +598,11 @@ If this option is specified as an empty string, it cancels
the option, leaving it unspecified for the tag (the default).
If the option is specified as a non-empty string that is
an empty list, such as \fB\-tags\0{\0}\fR, then it requests
-default 8-character tabs as described for the \fBtags\fR
+default 8-character tabs as described for the \fB\-tags\fR
widget option.
.TP
\fB\-tabstyle \fIstyle\fR
-\fIStyle\fR specifies either the \fItabular\fR or
+\fIStyle\fR specifies either the \fItabular\fR or
\fIwordprocessor\fR style of tabbing to use for the text widget.
This option only applies to a display line if it applies to the
first non-elided character on that display line.
@@ -640,7 +640,7 @@ Tcl command will be executed.
Tag bindings can be used to give behaviors to ranges of characters;
among other things, this allows hypertext-like
features to be implemented.
-For details, see the description of the \fBtag bind\fR widget
+For details, see the description of the ``\fIpathName \fBtag bind\fR'' widget
command below.
.VS 8.5
Tag bindings are shared between all peer widgets
@@ -702,7 +702,7 @@ until all mouse buttons have been released).
Neither of these special marks may be deleted.
.VS 8.5
With the exception of
-these two special marks, all marks are shared between peer text
+these two special marks, all marks are shared between peer text
widgets, and may be manipulated on an equal basis from any peer.
.VE 8.5
.SH "EMBEDDED WINDOWS"
@@ -734,9 +734,9 @@ destroyed.
.VE 8.5
.PP
When an embedded window is added to a text widget with the
-\fBwindow create\fR widget command, several configuration
+\fIpathName \fBwindow create\fR widget command, several configuration
options may be associated with it.
-These options may be modified later with the \fBwindow configure\fR
+These options may be modified later with the \fIpathName \fBwindow configure\fR
widget command.
The following options are currently supported:
.TP
@@ -812,11 +812,11 @@ unit's
worth of index space
in the text widget, and it may be referred to either by
its position in the widget's index space, or the name it is assigned
-when the image is inserted into the text widget with \fBimage create\fR.
+when the image is inserted into the text widget with \fIpathName \fBimage create\fR.
If the range of text containing the embedded image is deleted then
that copy of the image is removed from the screen.
.PP
-When an embedded image is added to a text widget with the \fBimage
+When an embedded image is added to a text widget with the \fIpathName \fBimage
create\fR widget command, a name unique to this instance of the image
is returned. This name may then be used to refer to this image
instance. The name is taken to be the value of the \fB\-name\fR option
@@ -825,14 +825,14 @@ instance. The name is taken to be the value of the \fB\-name\fR option
in use in the text widget, then \fB#\fInn\fR is added to the end of the
\fIimageName\fR, where \fInn\fR is an arbitrary integer. This insures
the \fIimageName\fR is unique.
-Once this name is assigned to this instance of the image, it does not
+Once this name is assigned to this instance of the image, it does not
change, even though the \fB\-image\fR or \fB\-name\fR values can be changed
-with \fBimage configure\fR.
+with \fIpathName \fBimage configure\fR.
.PP
When an embedded image is added to a text widget with the
-\fBimage create\fR widget command, several configuration
+\fIpathName \fBimage create\fR widget command, several configuration
options may be associated with it.
-These options may be modified later with the \fBimage configure\fR
+These options may be modified later with the \fIpathName \fBimage configure\fR
widget command.
The following options are currently supported:
.TP
@@ -883,7 +883,7 @@ If the selection is claimed away by another application or by another
window within this application, then the \fBsel\fR tag will be removed
from all characters in the text.
.IP [4]
-Whenever the \fBsel\fR tag range changes a virtual event
+Whenever the \fBsel\fR tag range changes a virtual event
\fB<<Selection>>\fR is generated.
.PP
The \fBsel\fR tag is automatically defined when a text widget is
@@ -897,7 +897,7 @@ other.
.VS 8.5
Also the
\fB\-inactiveselectionbackground\fR option for the text widget is used
-instead of \fB-selectbackground\fR when the text widget does not have
+instead of \fB\-selectbackground\fR when the text widget does not have
the focus. This allows programmatic control over the visualization of
the \fBsel\fR tag for foreground and background windows, or to have
\fBsel\fR not shown at all (when \fB\-inactiveselectionbackground\fR is
@@ -917,8 +917,8 @@ this point whenever the text widget has the input focus.
The text widget can keep track of changes to the content of the widget
by means of the modified flag. Inserting or deleting text will set
this flag. The flag can be queried, set and cleared programmatically
-as well. Whenever the flag changes state a \fB<<Modified>>\fR virtual
-event is generated. See the \fBedit modified\fR widget command for
+as well. Whenever the flag changes state a \fB<<Modified>>\fR virtual
+event is generated. See the \fIpathName \fBedit modified\fR widget command for
more details.
.SH "THE UNDO MECHANISM"
.PP
@@ -947,7 +947,7 @@ automatically to the appropriate state. This automatic coupling
does not work when the modified flag has been set by the user, until
the flag has been reset again.
.PP
-See below for the \fBedit\fR widget command that controls the undo
+See below for the \fIpathName \fBedit\fR widget command that controls the undo
mechanism.
.SH "PEER WIDGETS"
.PP
@@ -970,12 +970,12 @@ the \fBsel\fR tag may be set and configured (in its display style)
differently for each peer. Second, each peer has its own \fBinsert\fR
and \fBcurrent\fR mark positions (but all other marks are shared).
Third, embedded windows, which are arbitrary other widgets, cannot be
-shared between peers. This means the \fB-window\fR option of embedded
+shared between peers. This means the \fB\-window\fR option of embedded
windows is independently set for each peer (it is advisable to use
-the \fB-create\fR script capabilities to allow each peer to create its
+the \fB\-create\fR script capabilities to allow each peer to create its
own embedded windows as needed). Fourth, all of the configuration
-options of each peer (e.g. \fB-font\fR, etc) can be set independently,
-with the exception of \fB-undo\fR, \fB-maxUndo\fR, \fB-autoSeparators\fR
+options of each peer (e.g. \fB\-font\fR, etc) can be set independently,
+with the exception of \fB\-undo\fR, \fB\-maxUndo\fR, \fB\-autoSeparators\fR
(i.e. all undo, redo and modified state issues are shared).
.PP
Finally any single peer need not contain all lines from the underlying
@@ -993,18 +993,18 @@ end lines). Note that a peer which does not contain all of the
underlying data store still has indices numbered from "1.0" to "end".
It is simply that those indices reflect a subset of the total data, and
data outside the contained range is not accessible to the peer. This
-means that the command \fB$peer index end\fR may return quite different
-values in different peers. Similarly, commands like \fB$peer tag
+means that the command \fIpeerName \fBindex end\fR may return quite different
+values in different peers. Similarly, commands like \fIpeerName \fBtag
ranges\fR will not return index ranges outside that which is meaningful
-to the peer. The configuration options \fB-startline\fR and
-\fB-endline\fR may be used to control how much of the underlying data is
+to the peer. The configuration options \fB\-startline\fR and
+\fB\-endline\fR may be used to control how much of the underlying data is
contained in any given text widget.
.PP
Note that peers are really peers. Deleting the 'original' text widget
will not cause any other peers to be deleted, or otherwise affected.
.PP
-See below for the \fBpeer\fR widget command that controls the creation
-of peer widgets.
+See below for the \fIpathName \fBpeer\fR widget command that controls the
+creation of peer widgets.
.VE 8.5
.SH "WIDGET COMMAND"
.PP
@@ -1065,7 +1065,7 @@ command.
.TP
\fIpathName \fBcount\fR \fI?options\fR? \fIindex1 index2\fR
Counts the number of relevant things between the two indices.
-If \fIindex1\fR is after \fIindex2\fR, the result will be a negative number
+If \fIindex1\fR is after \fIindex2\fR, the result will be a negative number
(and this holds for each of the possible options).
The actual items which are counted depend on the
options given. The result is a list of integers, one for the result of
@@ -1080,37 +1080,37 @@ information is recalculated. This currently only has any effect for the
widget's current cached value for each line). The count options are
interpreted as follows:
.RS
-.IP \fB\-chars\fR
+.IP \fB\-chars\fR
count all characters, whether elided or not. Do not count
embedded windows or images.
-.IP \fB\-displaychars\fR
+.IP \fB\-displaychars\fR
count all non-elided characters.
-.IP \fB\-displayindices\fR
+.IP \fB\-displayindices\fR
count all non-elided characters, windows and images.
-.IP \fB\-displaylines\fR
+.IP \fB\-displaylines\fR
count all display lines (i.e. counting one for each
time a line wraps) from the line of the first index up to, but not
including the display line of the second index. Therefore if they are
both on the same display line, zero will be returned. By definition
displaylines are visible and therefore this only counts portions of
actual visible lines.
-.IP \fB\-indices\fR
+.IP \fB\-indices\fR
count all characters and embedded windows or images (i.e.
everything which counts in text-widget index space), whether they are
elided or not.
-.IP \fB\-lines\fR
+.IP \fB\-lines\fR
count all logical lines (irrespective of wrapping) from
the line of the first index up to, but not including the line of the
second index. Therefore if they are both on the same line, zero will be
returned. Logical lines are counted whether they are currently visible
(non-elided) or not.
-.IP \fB\-xpixels\fR
+.IP \fB\-xpixels\fR
count the number of horizontal pixels from the first
pixel of the first index to (but not including) the first pixel of the
second index. To count the total desired width of the text widget
(assuming wrapping is not enabled), first find the longest line and then
use '.text count \-xpixels "${line}.0" "${line}.0 lineend"'.
-.IP \fB\-ypixels\fR
+.IP \fB\-ypixels\fR
count the number of vertical pixels from the first pixel
of the first index to (but not including) the first pixel of the second
index. If both indices are on the same display line, zero will be
@@ -1118,9 +1118,9 @@ returned. To count the total number of vertical pixels in the text
widget, use '.text count \-ypixels 1.0 end', and to ensure this is up to
date, use '.text count \-update \-ypixels 1.0 end'.
.PP
-The command returns a positive or negative integer corresponding to the
+The command returns a positive or negative integer corresponding to the
number of items counted between the two indices. One such integer is
-returned for each counting option given, so a list is returned if more
+returned for each counting option given, so a list is returned if more
than one option was supplied. For example '.text count \-xpixels
\-ypixels 1.3 4.5' is perfectly valid and will return a list of two
elements.
@@ -1141,11 +1141,13 @@ There is a single debugging switch shared by all text widgets: turning
debugging on or off in any widget turns it on or off for all widgets.
For widgets with large amounts of text, the consistency checks may
cause a noticeable slow-down.
+.RS
.PP
When debugging is turned on, the drawing routines of the text widget
set the global variables \fBtk_textRedraw\fR and \fBtk_textRelayout\fR
to the lists of indices that are redrawn. The values of these variables
are tested by Tk's test suite.
+.RE
.TP
\fIpathName \fBdelete \fIindex1 \fR?\fIindex2 ...\fR?
Delete a range of characters from the text.
@@ -1294,10 +1296,10 @@ If the specified range contains embedded windows, no information
about them is included in the returned string.
If multiple index pairs are given, multiple ranges of text will be returned
in a list. Invalid ranges will not be represented with empty strings in
-the list. The ranges are returned in the order passed to \fBget\fR.
+the list. The ranges are returned in the order passed to \fIpathName \fBget\fR.
.VS 8.5
If the \fB\-displaychars\fR option is given, then, within each range,
-only those characters which are not elided will be returned. This may
+only those characters which are not elided will be returned. This may
have the effect that some of the returned ranges are empty strings.
.VE 8.5
.TP
@@ -1366,7 +1368,7 @@ tag names; the new characters will receive all of the tags in
this list and no others, regardless of the tags present around
the insertion point.
If multiple \fIchars\fR\-\fItagList\fR argument pairs are present,
-they produce the same effect as if a separate \fBinsert\fR widget
+they produce the same effect as if a separate \fIpathName \fBinsert\fR widget
command had been issued for each pair, in order.
The last \fItagList\fR argument may be omitted.
.TP
@@ -1398,9 +1400,9 @@ This can still return a mark at the same position if
there are multiple marks at the same index.
These semantics mean that the \fBmark next\fR operation can be used to
step through all the marks in a text widget in the same order
-as the mark information returned by the \fBdump\fR operation.
+as the mark information returned by the \fIpathName \fBdump\fR operation.
If a mark has been set to the special \fBend\fR index,
-then it appears to be \fIafter\fR \fBend\fR with respect to the \fBmark next\fR operation.
+then it appears to be \fIafter\fR \fBend\fR with respect to the \fIpathName \fBmark next\fR operation.
An empty string is returned if there are no marks after \fIindex\fR.
.TP
\fIpathName \fBmark previous \fIindex\fR
@@ -1411,9 +1413,9 @@ If \fIindex\fR is the name of a mark, then the search for
the next mark begins immediately before that mark.
This can still return a mark at the same position if
there are multiple marks at the same index.
-These semantics mean that the \fBmark previous\fR operation can be used to
+These semantics mean that the \fIpathName \fBmark previous\fR operation can be used to
step through all the marks in a text widget in the reverse order
-as the mark information returned by the \fBdump\fR operation.
+as the mark information returned by the \fIpathName \fBdump\fR operation.
An empty string is returned if there are no marks before \fIindex\fR.
.TP
\fIpathName \fBmark set \fImarkName index\fR
@@ -1449,7 +1451,7 @@ itself). The order within this list is undefined.
.RE
.TP
\fIpathName \fBreplace\fR \fIindex1 index2 chars\fR ?\fItagList chars tagList ...\fR?
-Replaces the range of characters between \fIindex1\fR and \fIindex2\fR
+Replaces the range of characters between \fIindex1\fR and \fIindex2\fR
with the given characters and tags. See the section on \fIpathName
\fBinsert\fR for an explanation of the handling of the \fItagList...\fR
arguments, and the section on \fIpathName
@@ -1470,14 +1472,14 @@ two forms, depending on \fIoption\fR:
.TP
\fIpathName \fBscan mark \fIx y\fR
Records \fIx\fR and \fIy\fR and the current view in the text window,
-for use in conjunction with later \fBscan dragto\fR commands.
+for use in conjunction with later \fIpathName \fBscan dragto\fR commands.
Typically this command is associated with a mouse button press in
the widget. It returns an empty string.
.TP
\fIpathName \fBscan dragto \fIx y\fR
This command computes the difference between its \fIx\fR and \fIy\fR
arguments and the \fIx\fR and \fIy\fR arguments to the last
-\fBscan mark\fR command for the widget.
+\fIpathName \fBscan mark\fR command for the widget.
It then adjusts the view by 10 times the difference in coordinates.
This command is typically associated
with mouse motion events in the widget, to produce the effect of
@@ -1521,17 +1523,17 @@ the text using the rules for regular expressions (see the \fBregexp\fR
command for details).
.VS 8.5
The default matching automatically passes
-both the \fB\-lineanchor\fR and \fB\-linestop\fR options
+both the \fB\-lineanchor\fR and \fB\-linestop\fR options
to the regexp engine (unless \fB\-nolinestop\fR is used), so that
-\fI^$\fR match beginning and end of line, and \fI.\fR, \fI[^\fR
+\fI^$\fR match beginning and end of line, and \fI.\fR, \fI[^\fR
sequences will never match the newline character \fI\en\fR.
.VE 8.5
.TP
\fB\-nolinestop\fR
.VS 8.5
-This allows \fI.\fR and \fI[^\fR sequences to match the newline
+This allows \fI.\fR and \fI[^\fR sequences to match the newline
character \fI\en\fR, which they will otherwise not do (see the \fBregexp\fR
-command for details). This option is only meaningful if \fB\-regexp\fR
+command for details). This option is only meaningful if \fB\-regexp\fR
is also given, and an error will be thrown otherwise. For example,
to match the entire text, use 'search \-nolinestop \-regexp ".*" 1.0'.
.VE 8.5
@@ -1551,20 +1553,20 @@ number of characters matched. In either case, the range \fImatchIdx\fR to
\fB\-all\fR
.VS 8.5
Find all matches in the given range and return a list of the indices of
-the first character of each match. If a \fB\-count\fI varName\fR switch is
-given, then \fBvarName\fR is also set to a list containing one element
+the first character of each match. If a \fB\-count\fI varName\fR switch is
+given, then \fIvarName\fR is also set to a list containing one element
for each successful match. Note that, even for exact searches, the
elements of this list may be different, if there are embedded images,
windows or hidden text. Searches with \fB\-all\fR behave very
similarly to the Tcl command \fBregexp \-all\fR, in that overlapping
matches are not normally returned. For example, applying an
-\fB\-all\fR search
+\fB\-all\fR search
of the pattern '\\w+' against 'hello there' will just match twice, once
for each word, and matching 'Z[a\-z]+Z' against 'ZooZooZoo' will just
match once.
.VE 8.5
.TP
-\fB\-overlap\fR
+\fB\-overlap\fR
.VS 8.5
When performing \fB\-all\fR searches, the normal behaviour is that
matches which overlap an already-found match will not be returned. This
@@ -1572,11 +1574,11 @@ switch changes that behaviour so that all matches which are not totally
enclosed within another match are returned. For example, applying an
\fB\-overlap\fR search of the pattern '\\w+' against 'hello there' will
just match twice (i.e. no different to just \fB\-all\fR),
-but matching 'Z[a\-z]+Z' against 'ZooZooZoo' will now match twice.
+but matching 'Z[a\-z]+Z' against 'ZooZooZoo' will now match twice.
An error will be thrown if this switch is used without \fB\-all\fR.
.VE 8.5
.TP
-\fB\-strictlimits\fR
+\fB\-strictlimits\fR
.VS 8.5
When performing any search, the normal behaviour is that
the start and stop limits are checked with respect to the
@@ -1593,7 +1595,7 @@ searched.
This switch has no effect except to terminate the list of switches:
the next argument will be treated as \fIpattern\fR even if it starts
with \fB\-\fR.
-.LP
+.PP
.VS 8.5
The matching range may be within a single line of text, or run across
multiple lines (if parts of the pattern can match a new-line). For
@@ -1609,10 +1611,10 @@ If \fIstopIndex\fR is omitted, the entire text will be searched:
when the beginning or end of the text is reached, the search
continues at the other end until the starting location is reached
again; if \fIstopIndex\fR is specified, no wrap-around will occur.
-This means that, for example, if the search is \fB\-forwards\fR
-but \fIstopIndex\fR is earlier in the text than \fIstartIndex\fR,
+This means that, for example, if the search is \fB\-forwards\fR
+but \fIstopIndex\fR is earlier in the text than \fIstartIndex\fR,
nothing will ever be found. See \fBKNOWN BUGS\fR below for a number of
-minor limitations of the \fBsearch\fR command.
+minor limitations of the \fIpathName \fBsearch\fR command.
.RE
.TP
\fIpathName \fBsee \fIindex\fR
@@ -1669,7 +1671,7 @@ defined for \fItagName\fR.
.RS
.PP
The only events for which bindings may be specified are those related
-to the mouse and keyboard (such as \fBEnter\fR, \fBLeave\fR,
+to the mouse and keyboard (such as \fBEnter\fR, \fBLeave\fR,
\fBButtonPress\fR, \fBMotion\fR, and \fBKeyPress\fR) or virtual events.
Event bindings for a text widget use the \fBcurrent\fR mark described
under \fBMARKS\fR above. An \fBEnter\fR event triggers for a tag when the tag
@@ -1705,11 +1707,11 @@ for the window as a whole.
\fIpathName \fBtag cget\fR \fItagName option\fR
This command returns the current value of the option named \fIoption\fR
associated with the tag given by \fItagName\fR.
-\fIOption\fR may have any of the values accepted by the \fBtag configure\fR
-widget command.
+\fIOption\fR may have any of the values accepted by the \fIpathName \fBtag
+configure\fR widget command.
.TP
\fIpathName \fBtag configure \fItagName\fR ?\fIoption\fR? ?\fIvalue\fR? ?\fIoption value ...\fR?
-This command is similar to the \fBconfigure\fR widget command except
+This command is similar to the \fIpathName \fBconfigure\fR widget command except
that it modifies options associated with the tag given by \fItagName\fR
instead of modifying options for the overall text widget.
If no \fIoption\fR is specified, the command returns a list describing
@@ -1927,7 +1929,7 @@ appears at the top of the top line of the window.
pixel of the first character in the text, 0.33 indicates the pixel that is
one-third the way through the text; and so on.
.VS 8.5
-Values close to 1 will
+Values close to 1 will
indicate values close to the last pixel in the text (1 actually refers
to one pixel beyond the last pixel), but in such cases the widget will
never scroll beyond the last pixel, and so a value of 1 will effectively
@@ -1972,9 +1974,9 @@ it will be positioned at the bottom of the window.
.IP [4]
Otherwise, \fIindex\fR will be centered in the window.
.LP
-The \fB\-pickplace\fR option has been obsoleted by the \fBsee\fR widget
-command (\fBsee\fR handles both x- and y-motion to make a location
-visible, whereas \fB\-pickplace\fR only handles motion in y).
+The \fB\-pickplace\fR option has been obsoleted by the \fIpathName \fBsee\fR widget
+command (\fIpathName \fBsee\fR handles both x- and y-motion to make a location
+visible, whereas the \fB\-pickplace\fR mode only handles motion in y).
.RE
.TP
\fIpathName \fByview \fInumber\fR
@@ -2067,7 +2069,7 @@ and also extends the selection to that point.
.IP [14]
End and Control-e move the insertion cursor to the
end of the display line and clear any selection in the widget.
-Shift-End moves the cursor to the end of the display line and extends
+Shift-End moves the cursor to the end of the display line and extends
the selection to that point.
.IP [15]
Control-Home and Meta-< move the insertion cursor to the beginning of
@@ -2132,7 +2134,7 @@ Control-x deletes whatever is selected in the text widget
after copying it to the clipboard.
.IP [31]
Control-t reverses the order of the two characters to the right of
-the insertion cursor.
+the insertion cursor.
.IP [32]
Control-z (and Control-underscore on UNIX when \fBtk_strictMotif\fR is
true) undoes the last edit action if the \fB\-undo\fR option is true.
@@ -2148,7 +2150,8 @@ take place.
.PP
The behavior of texts can be changed by defining new bindings for
individual widgets or by redefining the class bindings.
-.SH "ISSUES CONCERNING CHARS AND INDICES"
+.SH "KNOWN ISSUES"
+.SS "ISSUES CONCERNING CHARS AND INDICES"
.VS 8.5
.PP
Before Tk 8.5, the widget used the string "chars" to refer to index
@@ -2159,9 +2162,9 @@ index modifiers "+N chars" and "\-N chars" continue to refer to indices.
One must use any of the full forms "+N any chars" or "\-N any chars" etc
to refer to actual character indices. This confusion may be fixed in a
future release by making the widget correctly interpret "+N chars" as a
-synonym for "+N any chars".
+synonym for "+N any chars".
.VE 8.5
-.SH "PERFORMANCE ISSUES"
+.SS "PERFORMANCE ISSUES"
.PP
Text widgets should run efficiently under a variety
of conditions. The text widget uses about 2-3 bytes of
@@ -2194,10 +2197,10 @@ especially if they have many marks and tags within them.
The display line with the insert cursor is redrawn each time the
cursor blinks, which causes a steady stream of graphics traffic.
Set the \fBinsertOffTime\fR attribute to 0 avoid this.
-.SH "KNOWN BUGS"
+.SS "KNOWN BUGS"
.VS 8.5
.PP
-The \fBsearch \-regexp\fR sub-command attempts to perform sophisticated
+The \fIpathName \fBsearch \-regexp\fR sub-command attempts to perform sophisticated
regexp matching across multiple lines in an efficient fashion (since Tk
8.5), examining each line individually, and then in small groups of lines,
whether searching forwards or backwards. Under certain conditions the
@@ -2214,9 +2217,9 @@ returns the incorrect code and adding a second extra line would actually
match, the text widget will return the wrong result. In practice this is
a rare problem, but it can occur, for example:
.CS
- pack [text .t]
- .t insert 1.0 "aaaa\\nbbbb\\ncccc\\nbbbb\\naaaa\\n"
- .t search \-regexp \-\- {(a+|b+\\nc+\\nb+)+\\na+} 1.0
+pack [text .t]
+\.t insert 1.0 "aaaa\\nbbbb\\ncccc\\nbbbb\\naaaa\\n"
+\.t search \-regexp \-\- {(a+|b+\\nc+\\nb+)+\\na+} 1.0
.CE
will not find a match when one exists of 19
characters starting from the first 'b'.
@@ -2224,20 +2227,20 @@ characters starting from the first 'b'.
Whenever one possible match is fully enclosed in another, the search
command will attempt to ensure only the larger match is returned.
When performing backwards regexp searches it is possible that Tcl
-will not always achieve this, in the case where a match is preceded by
+will not always achieve this, in the case where a match is preceded by
one or more short, non-overlapping matches, all of which are preceded
by a large match which actually encompasses all of them. The search
algorithm used by the widget does not look back arbitrarily far for a
possible match which might cover large portions of the widget.
For example:
.CS
- pack [text .t]
- .t insert 1.0 "aaaa\\nbbbb\\nbbbb\\nbbbb\\nbbbb\\n"
- .t search \-regexp \-backward \-\- {b+\\n|a+\\n(b+\\n)+} end
+pack [text .t]
+\.t insert 1.0 "aaaa\\nbbbb\\nbbbb\\nbbbb\\nbbbb\\n"
+\.t search \-regexp \-backward \-\- {b+\\n|a+\\n(b+\\n)+} end
.CE
-matches at '5.0' when a true greedy match would match at '1.0'.
-Similarly if we add \fB\-all\fR to this case, it matches at
-all of '5.0', '4.0', '3.0' and '1.0',
+matches at '5.0' when a true greedy match would match at '1.0'.
+Similarly if we add \fB\-all\fR to this case, it matches at
+all of '5.0', '4.0', '3.0' and '1.0',
when really it should only match at '1.0' since that match
encloses all the others.
.VE 8.5
diff --git a/library/demos/widget b/library/demos/widget
index 458a384..b39cb49 100644
--- a/library/demos/widget
+++ b/library/demos/widget
@@ -10,7 +10,7 @@ exec wish "$0" "$@"
# separate ".tcl" files is this directory, which are sourced by this script as
# needed.
#
-# RCS: @(#) $Id: widget,v 1.29.2.2 2007/10/16 04:03:54 dgp Exp $
+# RCS: @(#) $Id: widget,v 1.29.2.3 2007/10/17 14:37:05 dgp Exp $
package require Tcl 8.5
package require Tk 8.5
@@ -32,10 +32,9 @@ if {[tk windowingsystem] eq "x11"} {
wm iconname . [mc "tkWidgetDemo"]
}
-if {[lsearch -exact [font names] defaultFont] == -1} {
+if {"defaultFont" ni [font names]} {
# TIP #145 defines some standard named fonts
- if {[lsearch -exact [font names] TkDefaultFont] != -1 &&
- [lsearch -exact [font names] TkFixedFont] != -1} {
+ if {"TkDefaultFont" in [font names] && "TkFixedFont" in [font names]} {
# FIX ME: the following tecnique of cloning the font to copy it works
# fine but means that if the system font is changed by Tk
# cannot update the copied font. font alias might be useful
@@ -107,6 +106,48 @@ image create photo ::img::print -height 19 -format GIF -data {
DkkpsKV5OYhjBxCMYAICAigUEAA7
}
+image create photo ::img::new -format GIF -data {
+ R0lGODlhHgAOAPcAAAAAAIAAAACAAICAAAAAgIAAgACAgICAgMDAwP8AAAD/
+ AP//AAAA//8A/wD//////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+ AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+ AAAAMwAAZgAAmQAAzAAA/wAzAAAzMwAzZgAzmQAzzAAz/wBmAABmMwBmZgBm
+ mQBmzABm/wCZAACZMwCZZgCZmQCZzACZ/wDMAADMMwDMZgDMmQDMzADM/wD/
+ AAD/MwD/ZgD/mQD/zAD//zMAADMAMzMAZjMAmTMAzDMA/zMzADMzMzMzZjMz
+ mTMzzDMz/zNmADNmMzNmZjNmmTNmzDNm/zOZADOZMzOZZjOZmTOZzDOZ/zPM
+ ADPMMzPMZjPMmTPMzDPM/zP/ADP/MzP/ZjP/mTP/zDP//2YAAGYAM2YAZmYA
+ mWYAzGYA/2YzAGYzM2YzZmYzmWYzzGYz/2ZmAGZmM2ZmZmZmmWZmzGZm/2aZ
+ AGaZM2aZZmaZmWaZzGaZ/2bMAGbMM2bMZmbMmWbMzGbM/2b/AGb/M2b/Zmb/
+ mWb/zGb//5kAAJkAM5kAZpkAmZkAzJkA/5kzAJkzM5kzZpkzmZkzzJkz/5lm
+ AJlmM5lmZplmmZlmzJlm/5mZAJmZM5mZZpmZmZmZzJmZ/5nMAJnMM5nMZpnM
+ mZnMzJnM/5n/AJn/M5n/Zpn/mZn/zJn//8wAAMwAM8wAZswAmcwAzMwA/8wz
+ AMwzM8wzZswzmcwzzMwz/8xmAMxmM8xmZsxmmcxmzMxm/8yZAMyZM8yZZsyZ
+ mcyZzMyZ/8zMAMzMM8zMZszMmczMzMzM/8z/AMz/M8z/Zsz/mcz/zMz///8A
+ AP8AM/8AZv8Amf8AzP8A//8zAP8zM/8zZv8zmf8zzP8z//9mAP9mM/9mZv9m
+ mf9mzP9m//+ZAP+ZM/+ZZv+Zmf+ZzP+Z///MAP/MM//MZv/Mmf/MzP/M////
+ AP//M///Zv//mf//zP///yH5BAEAABAALAAAAAAeAA4AAAiWAMMJFPhvYEGC
+ /xIeDLdw4UCC+gr+i8hQn0WLEilOdAiRW0R9HidyGznyY0iQFA2CROGRG8uV
+ KGK+dNnyZUOYI2eyJGmR5sqQKl3u1FnSJNGUFWmy1BnzJM2cQDsu9fk0osip
+ NoMOPYrx51SkV3MS5enV502qTGV6LIu0o0mTJEOKRMkRYsaMF1NubPuQoUGD
+ Ch0q7BsQADs=
+}
+apply {{} {
+ # Fix the 'new' image's lack of transparency using a "once only" procedure
+ # (really a lambda application...)
+ # TODO: rework the image to have the transparent bit set
+ set i ::img::new
+ set t "255 0 255"
+ set w [image width $i]
+ set h [image height $i]
+
+ for {set x 0} {$x < $w} {incr x} {
+ for {set y 0} {$y < $h} {incr y} {
+ if {[$i get $x $y] eq $t} {
+ $i trans set $x $y 1
+ }
+ }
+ }
+}}
+
#----------------------------------------------------------------
# The code below create the main window, consisting of a menu bar and a text
# widget that explains how to use the program, plus lists all of the demos as
@@ -209,32 +250,61 @@ set lastLine ""
}
showStatus [.t index {@%x,%y}]
}
-
+
+##############################################################################
# Create the text for the text widget.
# addFormattedText --
#
# Add formatted text (but not hypertext) to the text widget after first
# passing it through the message catalog to allow for localization.
-# Lines starting with @@ are formatting directives (begin newline, or
-# change style) and all other lines are literal strings to be inserted.
-# Blank lines are ignored.
+# Lines starting with @@ are formatting directives (insert title, insert
+# demo hyperlink, begin newline, or change style) and all other lines
+# are literal strings to be inserted. Blank lines are ignored.
#
proc addFormattedText {formattedText} {
set style normal
set isNL 1
+ set demoCount 0
+ set new 0
foreach line [split [mc $formattedText] \n] {
set line [string trim $line]
if {$line eq ""} {
continue
}
- if {$line eq "@@newline"} {
- .t insert end \n $style
- set isNL 1
- continue
- }
if {[string match @@* $line]} {
- set style [string range $line 2 end]
+ set data [string range $line 2 end]
+ set key [lindex $data 0]
+ set values [lrange $data 1 end]
+ switch -exact -- $key {
+ title {
+ .t insert end [mc $values]\n title \n normal
+ }
+ newline {
+ .t insert end \n $style
+ set isNL 1
+ }
+ subtitle {
+ .t insert end "\n" {} [mc $values] title " \n " demospace
+ set demoCount 0
+ }
+ demo {
+ set description [lassign $values name]
+ .t insert end "[incr demoCount]. [mc $description]." \
+ [list demo demo-$name]
+ if {$new} {
+ .t image create end -image ::img::new
+ set new 0
+ }
+ .t insert end " \n " demospace
+ }
+ new {
+ set new 1
+ }
+ default {
+ set style $key
+ }
+ }
continue
}
if {!$isNL} {
@@ -245,27 +315,8 @@ proc addFormattedText {formattedText} {
}
}
-# addDemoSection --
-#
-# Add a new section of demos with a title and a (stride-2) list of demo
-# files and their descriptions. Titles and descriptions are passed
-# through the message catalog to allow for localization.
-#
-proc addDemoSection {title demos} {
- .t insert end "\n" {} [mc $title] title " \n " demospace
- set num 0
- foreach {name description} $demos {
- .t insert end "[incr num]. [mc $description]." [list demo demo-$name]
- .t insert end " \n " demospace
- }
-}
-
addFormattedText {
- @@title
- Tk Widget Demonstrations
- @@newline
- @@normal
- @@newline
+ @@title Tk Widget Demonstrations
This application provides a front end for several short scripts
that demonstrate what you can do with Tk widgets. Each of the
@@ -283,76 +334,83 @@ addFormattedText {
button in the code window to reinvoke the demonstration with the
modified code.
@@newline
-}
-addDemoSection "Labels, buttons, checkbuttons, and radiobuttons" {
- label "Labels (text and bitmaps)"
- unicodeout "Labels and UNICODE text"
- button "Buttons"
- check "Check-buttons (select any of a group)"
- radio "Radio-buttons (select one of a group)"
- puzzle "A 15-puzzle game made out of buttons"
- icon "Iconic buttons that use bitmaps"
- image1 "Two labels displaying images"
- image2 "A simple user interface for viewing images"
- labelframe "Labelled frames"
-}
-addDemoSection "Listboxes" {
- states "The 50 states"
- colors "Colors: change the color scheme for the application"
- sayings "A collection of famous and infamous sayings"
-}
-addDemoSection "Entries and Spin-boxes" {
- entry1 "Entries without scrollbars"
- entry2 "Entries with scrollbars"
- entry3 "Validated entries and password fields"
- spin "Spin-boxes"
- form "Simple Rolodex-like form"
-}
-addDemoSection "Text" {
- text "Basic editable text"
- style "Text display styles"
- bind "Hypertext (tag bindings)"
- twind "A text widget with embedded windows and other features"
- search "A search tool built with a text widget"
- textpeer "Peering text widgets"
-}
-addDemoSection "Canvases" {
- items "The canvas item types"
- plot "A simple 2-D plot"
- ctext "Text items in canvases"
- arrow "An editor for arrowheads on canvas lines"
- ruler "A ruler with adjustable tab stops"
- floor "A building floor plan"
- cscroll "A simple scrollable canvas"
-}
-addDemoSection "Scales" {
- hscale "Horizontal scale"
- vscale "Vertical scale"
-}
-addDemoSection "Paned Windows" {
- paned1 "Horizontal paned window"
- paned2 "Vertical paned window"
-}
-addDemoSection "Menus" {
- menu "Menus and cascades (sub-menus)"
- menubu "Menu-buttons"
-}
-addDemoSection "Common Dialogs" {
- msgbox "Message boxes"
- filebox "File selection dialog"
- clrpick "Color picker"
-}
-addDemoSection "Animation" {
- anilabel "Animated labels"
- aniwave "Animated wave"
- pendulum "Pendulum simulation"
- goldberg "A celebration of Rube Goldberg"
-}
-addDemoSection "Miscellaneous" {
- bitmap "The built-in bitmaps"
- dialog1 "A dialog box with a local grab"
- dialog2 "A dialog box with a global grab"
-}
+
+ @@subtitle Labels, buttons, checkbuttons, and radiobuttons
+ @@demo label Labels (text and bitmaps)
+ @@demo unicodeout Labels and UNICODE text
+ @@demo button Buttons
+ @@demo check Check-buttons (select any of a group)
+ @@demo radio Radio-buttons (select one of a group)
+ @@demo puzzle A 15-puzzle game made out of buttons
+ @@demo icon Iconic buttons that use bitmaps
+ @@demo image1 Two labels displaying images
+ @@demo image2 A simple user interface for viewing images
+ @@demo labelframe Labelled frames
+
+ @@subtitle Listboxes
+ @@demo states The 50 states
+ @@demo colors Colors: change the color scheme for the application
+ @@demo sayings A collection of famous and infamous sayings
+
+ @@subtitle Entries and Spin-boxes
+ @@demo entry1 Entries without scrollbars
+ @@demo entry2 Entries with scrollbars
+ @@demo entry3 Validated entries and password fields
+ @@demo spin Spin-boxes
+ @@demo form Simple Rolodex-like form
+
+ @@subtitle Text
+ @@demo text Basic editable text
+ @@demo style Text display styles
+ @@demo bind Hypertext (tag bindings)
+ @@demo twind A text widget with embedded windows and other features
+ @@demo search A search tool built with a text widget
+ @@new
+ @@demo textpeer Peering text widgets
+
+ @@subtitle Canvases
+ @@demo items The canvas item types
+ @@demo plot A simple 2-D plot
+ @@demo ctext Text items in canvases
+ @@demo arrow An editor for arrowheads on canvas lines
+ @@demo ruler A ruler with adjustable tab stops
+ @@demo floor A building floor plan
+ @@demo cscroll A simple scrollable canvas
+
+ @@subtitle Scales
+ @@demo hscale Horizontal scale
+ @@demo vscale Vertical scale
+
+ @@subtitle Paned Windows
+ @@demo paned1 Horizontal paned window
+ @@demo paned2 Vertical paned window
+
+ @@subtitle Menus
+ @@demo menu Menus and cascades (sub-menus)
+ @@demo menubu Menu-buttons
+
+ @@subtitle Common Dialogs
+ @@demo msgbox Message boxes
+ @@demo filebox File selection dialog
+ @@demo clrpick Color picker
+
+ @@subtitle Animation
+ @@new
+ @@demo anilabel Animated labels
+ @@new
+ @@demo aniwave Animated wave
+ @@new
+ @@demo pendulum Pendulum simulation
+ @@new
+ @@demo goldberg A celebration of Rube Goldberg
+
+ @@subtitle Miscellaneous
+ @@demo bitmap The built-in bitmaps
+ @@demo dialog1 A dialog box with a local grab
+ @@demo dialog2 A dialog box with a global grab
+}
+
+##############################################################################
.t configure -state disabled
focus .s
diff --git a/library/ttk/winTheme.tcl b/library/ttk/winTheme.tcl
index 34a6bc3..30736f8 100644
--- a/library/ttk/winTheme.tcl
+++ b/library/ttk/winTheme.tcl
@@ -1,14 +1,13 @@
#
-# $Id: winTheme.tcl,v 1.3 2006/12/18 19:33:14 jenglish Exp $
+# $Id: winTheme.tcl,v 1.3.2.1 2007/10/17 14:37:05 dgp Exp $
#
-# Ttk widget set: Windows Native theme
+# Settings for 'winnative' theme.
#
-namespace eval ttk {
+namespace eval ttk::theme::winnative {
+ ttk::style theme settings winnative {
- style theme settings winnative {
-
- style configure "." \
+ ttk::style configure "." \
-background SystemButtonFace \
-foreground SystemWindowText \
-selectforeground SystemHighlightText \
@@ -17,60 +16,61 @@ namespace eval ttk {
-font TkDefaultFont \
;
- style map "." -foreground [list disabled SystemGrayText] ;
- style map "." -embossed [list disabled 1] ;
+ ttk::style map "." -foreground [list disabled SystemGrayText] ;
+ ttk::style map "." -embossed [list disabled 1] ;
- style configure TButton -width -11 -relief raised -shiftrelief 1
- style configure TCheckbutton -padding "2 4"
- style configure TRadiobutton -padding "2 4"
- style configure TMenubutton \
+ ttk::style configure TButton -width -11 -relief raised -shiftrelief 1
+ ttk::style configure TCheckbutton -padding "2 4"
+ ttk::style configure TRadiobutton -padding "2 4"
+ ttk::style configure TMenubutton \
-padding "8 4" -arrowsize 3 -relief raised -anchor w
- style map TButton -relief {{!disabled pressed} sunken}
+ ttk::style map TButton -relief {{!disabled pressed} sunken}
- style configure TEntry \
+ ttk::style configure TEntry \
-padding 2 -selectborderwidth 0 -insertwidth 1
- style map TEntry \
+ ttk::style map TEntry \
-fieldbackground \
[list readonly SystemButtonFace disabled SystemButtonFace] \
-selectbackground [list !focus SystemWindow] \
-selectforeground [list !focus SystemWindowText] \
;
- style configure TCombobox -padding 2
- style map TCombobox \
+ ttk::style configure TCombobox -padding 2
+ ttk::style map TCombobox \
-selectbackground [list !focus SystemWindow] \
-selectforeground [list !focus SystemWindowText] \
-foreground [list {readonly focus} SystemHighlightText] \
-focusfill [list {readonly focus} SystemHighlight] \
;
- style configure TLabelframe -borderwidth 2 -relief groove
+ ttk::style configure TLabelframe -borderwidth 2 -relief groove
- style configure Toolbutton -relief flat -padding {8 4}
- style map Toolbutton -relief \
+ ttk::style configure Toolbutton -relief flat -padding {8 4}
+ ttk::style map Toolbutton -relief \
{disabled flat selected sunken pressed sunken active raised}
- style configure TScale -groovewidth 4
+ ttk::style configure TScale -groovewidth 4
- style configure TNotebook -tabmargins {2 2 2 0}
- style configure TNotebook.Tab -padding {3 1} -borderwidth 1
- style map TNotebook.Tab -expand [list selected {2 2 2 0}]
+ ttk::style configure TNotebook -tabmargins {2 2 2 0}
+ ttk::style configure TNotebook.Tab -padding {3 1} -borderwidth 1
+ ttk::style map TNotebook.Tab -expand [list selected {2 2 2 0}]
# Treeview:
- style configure Heading -font TkHeadingFont -relief raised
- style configure Row -background SystemWindow
- style configure Cell -background SystemWindow
- style map Row \
+ ttk::style configure Heading -font TkHeadingFont -relief raised
+ ttk::style configure Row -background SystemWindow
+ ttk::style configure Cell -background SystemWindow
+ ttk::style map Row \
-background [list selected SystemHighlight] \
-foreground [list selected SystemHighlightText] ;
- style map Cell \
+ ttk::style map Cell \
-background [list selected SystemHighlight] \
-foreground [list selected SystemHighlightText] ;
- style map Item \
+ ttk::style map Item \
-background [list selected SystemHighlight] \
-foreground [list selected SystemHighlightText] ;
- style configure TProgressbar -borderwidth 0 -background SystemHighlight
+ ttk::style configure TProgressbar \
+ -background SystemHighlight -borderwidth 0 ;
}
}
diff --git a/library/ttk/xpTheme.tcl b/library/ttk/xpTheme.tcl
index 5320b85..7420950 100644
--- a/library/ttk/xpTheme.tcl
+++ b/library/ttk/xpTheme.tcl
@@ -1,15 +1,14 @@
#
-# $Id: xpTheme.tcl,v 1.3 2006/12/18 19:33:14 jenglish Exp $
+# $Id: xpTheme.tcl,v 1.3.2.1 2007/10/17 14:37:05 dgp Exp $
#
-# Ttk widget set: XP Native theme
+# Settings for 'xpnative' theme
#
-# @@@ todo: spacing and padding needs tweaking
-namespace eval ttk {
+namespace eval ttk::theme::xpnative {
- style theme settings xpnative {
+ ttk::style theme settings xpnative {
- style configure . \
+ ttk::style configure . \
-background SystemButtonFace \
-foreground SystemWindowText \
-selectforeground SystemHighlightText \
@@ -17,49 +16,49 @@ namespace eval ttk {
-font TkDefaultFont \
;
- style map "." \
+ ttk::style map "." \
-foreground [list disabled SystemGrayText] \
;
- style configure TButton -padding {1 1} -width -11
- style configure TRadiobutton -padding 2
- style configure TCheckbutton -padding 2
- style configure TMenubutton -padding {8 4} -anchor w
+ ttk::style configure TButton -padding {1 1} -width -11
+ ttk::style configure TRadiobutton -padding 2
+ ttk::style configure TCheckbutton -padding 2
+ ttk::style configure TMenubutton -padding {8 4} -anchor w
- style configure TNotebook -tabmargins {2 2 2 0}
- style map TNotebook.Tab \
+ ttk::style configure TNotebook -tabmargins {2 2 2 0}
+ ttk::style map TNotebook.Tab \
-expand [list selected {2 2 2 2}]
# Treeview:
- style configure Heading -font TkHeadingFont
- style configure Row -background SystemWindow
- style configure Cell -background SystemWindow
- style map Row \
+ ttk::style configure Heading -font TkHeadingFont
+ ttk::style configure Row -background SystemWindow
+ ttk::style configure Cell -background SystemWindow
+ ttk::style map Row \
-background [list selected SystemHighlight] \
-foreground [list selected SystemHighlightText] ;
- style map Cell \
+ ttk::style map Cell \
-background [list selected SystemHighlight] \
-foreground [list selected SystemHighlightText] ;
- style map Item \
+ ttk::style map Item \
-background [list selected SystemHighlight] \
-foreground [list selected SystemHighlightText] ;
- style configure TLabelframe -foreground "#0046d5"
+ ttk::style configure TLabelframe -foreground "#0046d5"
# OR: -padding {3 3 3 6}, which some apps seem to use.
- style configure TEntry -padding {2 2 2 4}
- style map TEntry \
+ ttk::style configure TEntry -padding {2 2 2 4}
+ ttk::style map TEntry \
-selectbackground [list !focus SystemWindow] \
-selectforeground [list !focus SystemWindowText] \
;
- style configure TCombobox -padding 2
- style map TCombobox \
+ ttk::style configure TCombobox -padding 2
+ ttk::style map TCombobox \
-selectbackground [list !focus SystemWindow] \
-selectforeground [list !focus SystemWindowText] \
-foreground [list {readonly focus} SystemHighlightText] \
-focusfill [list {readonly focus} SystemHighlight] \
;
- style configure Toolbutton -padding {4 4}
+ ttk::style configure Toolbutton -padding {4 4}
}
}
diff --git a/win/makefile.vc b/win/makefile.vc
index 5c5db30..279bdbf 100644
--- a/win/makefile.vc
+++ b/win/makefile.vc
@@ -12,7 +12,7 @@
# Copyright (c) 2001-2004 David Gravereaux.
#
#------------------------------------------------------------------------------
-# RCS: @(#) $Id: makefile.vc,v 1.103.2.3 2007/10/15 18:38:41 dgp Exp $
+# RCS: @(#) $Id: makefile.vc,v 1.103.2.4 2007/10/17 14:37:05 dgp Exp $
#------------------------------------------------------------------------------
# Check to see we are configured to build with MSVC (MSDEVDIR or MSVCDIR)
@@ -186,7 +186,7 @@ PROJECT = tk
# Extra makefile options processing...
!if "$(OPTS)" == "" || [nmakehlp -f "$(OPTS)" "none"]
-HAVE_UXTHEME = 1
+HAVE_UXTHEME_H = 1
TTK_SQUARE_WIDGET = 0
!else
!if [nmakehlp -f $(OPTS) "noxp"]
@@ -651,23 +651,6 @@ genstubs:
#---------------------------------------------------------------------
-# Generate the makefile depedancies.
-#---------------------------------------------------------------------
-
-depend:
-!if !exist($(TCLSH))
- @echo Build tclsh first!
-!else
- set TCL_LIBRARY=$(TCL_LIBRARY)
- $(TCLSH) $(TOOLSDIR:\=/)/mkdepend.tcl -vc32 -out:"$(OUT_DIR)\depend.mk" \
- -passthru:"-DBUILD_tcl $(TK_INCLUDES:"="")" $(GENERICDIR) \
- $(COMPATDIR) $(WINDIR) @<<
-$(TKOBJS)
-<<
-!endif
-
-
-#---------------------------------------------------------------------
# Regenerate the windows help files.
#---------------------------------------------------------------------
@@ -791,84 +774,38 @@ $(TMP_DIR)\tkStubLib.obj : $(GENERICDIR)\tkStubLib.c
$(cc32) $(STUB_CFLAGS) $(TK_INCLUDES) -Zl -DSTATIC_BUILD -Fo$@ $?
-#---------------------------------------------------------------------
-# Dedependency rules
-#---------------------------------------------------------------------
-
$(TMP_DIR)\wish.exe.manifest: $(WINDIR)\wish.exe.manifest.in
@nmakehlp -s << $** >$@
@MACHINE@ $(MACHINE:IX86=X86)
@TK_WIN_VERSION@ $(TK_MAJOR_VERSION).$(TK_MINOR_VERSION).0.0
<<
+#---------------------------------------------------------------------
+# Generate the makefile depedancies.
+#---------------------------------------------------------------------
+
+depend:
+!if !exist($(TCLSH))
+ @echo Build tclsh first!
+!else
+ set TCL_LIBRARY=$(TCL_LIBRARY)
+ $(TCLSH) $(TCLTOOLSDIR)\mkdepend.tcl -vc32 -out:"$(OUT_DIR)\depend.mk" \
+ -passthru:"-DBUILD_tk $(TK_INCLUDES)" $(GENERICDIR),$$(GENERICDIR) \
+ $(WINDIR),$$(WINDIR) $(TTKDIR),$$(TTKDIR) $(XLIBDIR),$$(XLIBDIR) @<<
+$(TKOBJS)
+<<
+!endif
+
+
+#---------------------------------------------------------------------
+# Dedependency rules
+#---------------------------------------------------------------------
+
$(TMP_DIR)\tk.res: \
$(RCDIR)\buttons.bmp \
$(RCDIR)\cursor*.cur \
$(RCDIR)\tk.ico
-$(GENERICDIR)/default.h: $(WINDIR)/tkWinDefault.h
-$(GENERICDIR)/tkButton.c: $(GENERICDIR)/default.h
-$(GENERICDIR)/tkCanvas.c: $(GENERICDIR)/default.h
-$(GENERICDIR)/tkEntry.c: $(GENERICDIR)/default.h
-$(GENERICDIR)/tkFrame.c: $(GENERICDIR)/default.h
-$(GENERICDIR)/tkListbox.c: $(GENERICDIR)/default.h
-$(GENERICDIR)/tkMenu.c: $(GENERICDIR)/default.h
-$(GENERICDIR)/tkMenubutton.c: $(GENERICDIR)/default.h
-$(GENERICDIR)/tkMessage.c: $(GENERICDIR)/default.h
-$(GENERICDIR)/tkPanedWindow.c: $(GENERICDIR)/default.h
-$(GENERICDIR)/tkScale.c: $(GENERICDIR)/default.h
-$(GENERICDIR)/tkScrollbar.c: $(GENERICDIR)/default.h
-$(GENERICDIR)/tkText.c: $(GENERICDIR)/default.h
-$(GENERICDIR)/tkTextIndex.c: $(GENERICDIR)/default.h
-$(GENERICDIR)/tkTextTag.c: $(GENERICDIR)/default.h
-$(GENERICDIR)/tkUndo.c: $(GENERICDIR)/tkUndo.h
-
-$(GENERICDIR)/tkText.c: $(GENERICDIR)/tkText.h
-$(GENERICDIR)/tkTest.c: $(GENERICDIR)/tkText.h
-$(GENERICDIR)/tkTextBTree.c: $(GENERICDIR)/tkText.h
-$(GENERICDIR)/tkTextDisp.c: $(GENERICDIR)/tkText.h
-$(GENERICDIR)/tkTextDisp.c: $(GENERICDIR)/tkText.h
-$(GENERICDIR)/tkTextImage.c: $(GENERICDIR)/tkText.h
-$(GENERICDIR)/tkTextIndex.c: $(GENERICDIR)/tkText.h
-$(GENERICDIR)/tkTextMark.c: $(GENERICDIR)/tkText.h
-$(GENERICDIR)/tkTextTag.c: $(GENERICDIR)/tkText.h
-$(GENERICDIR)/tkTextWind.c: $(GENERICDIR)/tkText.h
-
-$(GENERICDIR)/tkMacWinMenu.c: $(GENERICDIR)/tkMenu.h
-$(GENERICDIR)/tkMenu.c: $(GENERICDIR)/tkMenu.h
-$(GENERICDIR)/tkMenuDraw.c: $(GENERICDIR)/tkMenu.h
-$(WINDIR)/tkWinMenu.c: $(GENERICDIR)/tkMenu.h
-
-$(TTKDIR)/ttkBlink.c: $(TTKDIR)/ttkTheme.h
-$(TTKDIR)/ttkButton.c: $(TTKDIR)/ttkTheme.h
-$(TTKDIR)/ttkCache.c: $(TTKDIR)/ttkTheme.h
-$(TTKDIR)/ttkClamTheme.c: $(TTKDIR)/ttkTheme.h
-$(TTKDIR)/ttkClassicTheme.c: $(TTKDIR)/ttkTheme.h
-$(TTKDIR)/ttkDefaultTheme.c: $(TTKDIR)/ttkTheme.h
-$(TTKDIR)/ttkElements.c: $(TTKDIR)/ttkTheme.h
-$(TTKDIR)/ttkEntry.c: $(TTKDIR)/ttkTheme.h
-$(TTKDIR)/ttkFrame.c: $(TTKDIR)/ttkTheme.h
-$(TTKDIR)/ttkImage.c: $(TTKDIR)/ttkTheme.h
-$(TTKDIR)/ttkInit.c: $(TTKDIR)/ttkTheme.h
-$(TTKDIR)/ttkLabel.c: $(TTKDIR)/ttkTheme.h
-$(TTKDIR)/ttkLayout.c: $(TTKDIR)/ttkTheme.h
-$(TTKDIR)/ttkManager.c: $(TTKDIR)/ttkTheme.h $(TTKDIR)/ttkManager.h
-$(TTKDIR)/ttkNotebook.c: $(TTKDIR)/ttkTheme.h
-$(TTKDIR)/ttkPanedwindow.c: $(TTKDIR)/ttkTheme.h
-$(TTKDIR)/ttkProgress.c: $(TTKDIR)/ttkTheme.h
-$(TTKDIR)/ttkScroll.c: $(TTKDIR)/ttkTheme.h
-$(TTKDIR)/ttkScrollbar.c: $(TTKDIR)/ttkTheme.h
-$(TTKDIR)/ttkSeparator.c: $(TTKDIR)/ttkTheme.h
-$(TTKDIR)/ttkSquare.c: $(TTKDIR)/ttkTheme.h
-$(TTKDIR)/ttkState.c: $(TTKDIR)/ttkTheme.h
-$(TTKDIR)/ttkTagSet.c: $(TTKDIR)/ttkTheme.h
-$(TTKDIR)/ttkTheme.c: $(TTKDIR)/ttkTheme.h
-$(TTKDIR)/ttkTrace.c: $(TTKDIR)/ttkTheme.h
-$(TTKDIR)/ttkTrack.c: $(TTKDIR)/ttkTheme.h
-$(TTKDIR)/ttkTreeview.c: $(TTKDIR)/ttkTheme.h
-$(TTKDIR)/ttkWidget.c: $(TTKDIR)/ttkTheme.h $(TTKDIR)/ttkWidget.h
-
-
!if exist("$(OUT_DIR)\depend.mk")
!include "$(OUT_DIR)\depend.mk"
!message *** Dependency rules in effect.