Skip to content

Commit

Permalink
Backport doc formatting improvements from 9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jan.nijtmans committed Sep 11, 2024
1 parent c17a596 commit 1240b42
Show file tree
Hide file tree
Showing 15 changed files with 389 additions and 251 deletions.
82 changes: 43 additions & 39 deletions doc/busy.n
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,21 @@
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
busy \- confine pointer events to a window sub-tree
busy \- Make Tk widgets busy, temporarily blocking user interactions
.SH SYNOPSIS
\fBtk busy\fR \fIwindow \fR?\fIoptions\fR?
.sp
\fBtk busy hold\fR \fIwindow \fR?\fIoptions\fR?
.sp
.nf
\fBtk busy\fI window \fR?\fIoptions\fR?
\fBtk busy hold\fI window \fR?\fIoptions\fR?
\fBtk busy configure \fIwindow\fR ?\fIoption value\fR?...
.sp
\fBtk busy forget\fR \fIwindow \fR?\fIwindow \fR?...
.sp
\fBtk busy forget\fI window \fR?\fIwindow \fR?...
\fBtk busy current\fR ?\fIpattern\fR?
.sp
\fBtk busy status \fIwindow\fR
.fi
.BE
.SH DESCRIPTION
.PP
The \fBtk busy\fR command provides a simple means to block pointer events from
Tk widgets, while overriding the widget's cursor with a configurable busy
The \fBtk busy\fR command provides a simple means to block mouse pointer events
from Tk widgets, while overriding the widget's cursor with a configurable busy
cursor. Note this command does not prevent keyboard events from being sent to
the widgets made busy.
.SH INTRODUCTION
Expand Down Expand Up @@ -114,7 +111,7 @@ The busy window has a configurable cursor. You can change the busy cursor
using the \fBconfigure\fR operation.
.PP
.CS
\fBtk busy\fR configure .top \-cursor "watch"
\fBtk busy\fR configure .top -cursor "watch"
.CE
.PP
Destroying the widget will also clean up any resources allocated by the \fBtk
Expand All @@ -127,33 +124,16 @@ The following operations are available for the \fBtk busy\fR command:
\fBtk busy \fIwindow\fR ?\fIoption value\fR?...
.
Shortcut for \fBtk busy hold\fR command.
.\" METHOD: cget
.TP
\fBtk busy hold \fIwindow\fR ?\fIoption value\fR?...
.
Makes the specified \fIwindow\fR (and its descendants in the Tk window
hierarchy) appear busy. \fIWindow\fR must be a valid path name of a Tk widget.
A transparent window is put in front of the specified window. This transparent
window is mapped the next time idle tasks are processed, and the specified
window and its descendants will be blocked from user interactions. Normally
\fBupdate\fR should be called immediately afterward to insure that the hold
operation is in effect before the application starts its processing. The
following configuration options are valid:
.RS
.TP
\fB\-cursor \fIcursorName\fR
.
Specifies the cursor to be displayed when the widget is made busy.
\fICursorName\fR can be in any form accepted by \fBTk_GetCursor\fR. The
default cursor is \fBwait\fR on Windows and \fBwatch\fR on other platforms.
.RE
.TP
\fBtk busy cget \fIwindow\fR \fIoption\fR
\fBtk busy cget \fIwindow option\fR
.
Queries the \fBtk busy\fR command configuration options for \fIwindow\fR.
\fIWindow\fR must be the path name of a widget previously made busy by the
\fBhold\fR operation. The command returns the present value of the specified
\fIoption\fR. \fIOption\fR may have any of the values accepted by the
\fBhold\fR operation.
.\" METHOD: configure
.TP
\fBtk busy configure \fIwindow\fR ?\fIoption value\fR?...
.
Expand All @@ -180,6 +160,14 @@ option add *frame.busyCursor gumby
option add *Frame.BusyCursor gumby
.CE
.RE
.\" METHOD: current
.TP
\fBtk busy current \fR?\fIpattern\fR?
.
Returns the pathnames of all widgets that are currently busy. If a
\fIpattern\fR is given, only the path names of busy widgets matching
\fIpattern\fR are returned.
.\" METHOD: forget
.TP
\fBtk busy forget \fIwindow\fR ?\fIwindow\fR?...
.
Expand All @@ -188,12 +176,28 @@ including the transparent window. User events will again be received by
\fIwindow\fR. Resources are also released when \fIwindow\fR is destroyed.
\fIWindow\fR must be the name of a widget specified in the \fBhold\fR
operation, otherwise an error is reported.
.\" METHOD: hold
.TP
\fBtk busy current \fR?\fIpattern\fR?
\fBtk busy hold \fIwindow\fR ?\fIoption value\fR?...
.
Returns the pathnames of all widgets that are currently busy. If a
\fIpattern\fR is given, only the path names of busy widgets matching
\fIpattern\fR are returned.
Makes the specified \fIwindow\fR (and its descendants in the Tk window
hierarchy) appear busy. \fIWindow\fR must be a valid path name of a Tk widget.
A transparent window is put in front of the specified window. This transparent
window is mapped the next time idle tasks are processed, and the specified
window and its descendants will be blocked from user interactions. Normally
\fBupdate\fR should be called immediately afterward to insure that the hold
operation is in effect before the application starts its processing. The
following configuration options are valid:
.RS
.\" OPTION: -cursor
.TP
\fB\-cursor \fIcursorName\fR
.
Specifies the cursor to be displayed when the widget is made busy.
\fICursorName\fR can be in any form accepted by \fBTk_GetCursor\fR. The
default cursor is \fBwait\fR on Windows and \fBwatch\fR on other platforms.
.RE
.\" METHOD: status
.TP
\fBtk busy status \fIwindow\fR
.
Expand All @@ -206,8 +210,8 @@ The event blocking feature is implemented by creating and mapping a
transparent window that completely covers the widget. When the busy window is
mapped, it invisibly shields the widget and its hierarchy from all events that
may be sent. Like Tk widgets, busy windows have widget names in the Tk window
hierarchy. This means that you can use the \fBbind\fR command, to handle
events in the busy window.
hierarchy. This means that you can use the \fBbind\fR command to handle
events in the busy window:
.PP
.CS
\fBtk busy\fR hold .frame.canvas
Expand Down Expand Up @@ -264,7 +268,7 @@ its descendants. It also makes sure it's not possible to leave button
\fB.cancel\fR using the keyboard.
.SH PORTABILITY
.PP
Note that the \fBtk busy\fR command does not currently have any effect on OSX
Note that the \fBtk busy\fR command does not currently have any effect on macOS
when Tk is built using Aqua support.
.SH "SEE ALSO"
grab(n)
Expand Down
26 changes: 17 additions & 9 deletions doc/button.n
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
.SH NAME
button \- Create and manipulate 'button' action widgets
.SH SYNOPSIS
\fBbutton\fR \fIpathName \fR?\fIoptions\fR?
\fBbutton\fI pathName \fR?\fIoptions\fR?
.SO
\-activebackground \-font \-relief
\-activeforeground \-foreground \-repeatdelay
Expand Down Expand Up @@ -109,19 +109,23 @@ name is \fIpathName\fR. This
command may be used to invoke various
operations on the widget. It has the following general form:
.CS
\fIpathName option \fR?\fIarg arg ...\fR?
\fIpathName option \fR?\fIarg ...\fR?
.CE
\fIOption\fR and the \fIarg\fRs
determine the exact behavior of the command. The following
commands are possible for button widgets:
.\" METHOD: cget
.TP
\fIpathName \fBcget\fR \fIoption\fR
\fIpathName \fBcget\fI option\fR
.
Returns the current value of the configuration option given
by \fIoption\fR.
\fIOption\fR may have any of the values accepted by the \fBbutton\fR
command.
.\" METHOD: configure
.TP
\fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
.
Query or modify the configuration options of the widget.
If no \fIoption\fR is specified, returns a list describing all of
the available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for
Expand All @@ -134,15 +138,19 @@ modifies the given widget option(s) to have the given value(s); in
this case the command returns an empty string.
\fIOption\fR may have any of the values accepted by the \fBbutton\fR
command.
.\" METHOD: flash
.TP
\fIpathName \fBflash\fR
.
Flash the button. This is accomplished by redisplaying the button
several times, alternating between the configured activebackground
and background colors. At the end of the flash the button is left
in the same normal/active state as when the command was invoked.
This command is ignored if the button's state is \fBdisabled\fR.
.\" METHOD: invoke
.TP
\fIpathName \fBinvoke\fR
.
Invoke the Tcl command associated with the button, if there is one.
The return value is the return value from the Tcl command, or an
empty string if there is no command associated with the button.
Expand Down Expand Up @@ -175,7 +183,7 @@ The behavior of buttons can be changed by defining new bindings for
individual widgets or by redefining the class bindings.
.SH "PLATFORM NOTES"
.PP
On Aqua/Mac OS X, some configuration options are ignored for the purpose of
On Aqua/macOS, some configuration options are ignored for the purpose of
drawing of the widget because they would otherwise conflict with platform
guidelines. The \fBconfigure\fR and \fBcget\fR subcommands can still
manipulate the values, but do not cause any variation to the look of the
Expand All @@ -188,17 +196,17 @@ This is the classic Tk
demonstration:
.PP
.CS
\fBbutton\fR .b \-text "Hello, World!" \-command exit
\fBbutton\fR .b -text "Hello, World!" -command exit
pack .b
.CE
.PP
This example demonstrates how to handle button accelerators:
.PP
.CS
\fBbutton\fR .b1 \-text Hello \-underline 0
\fBbutton\fR .b2 \-text World \-underline 0
bind . <Key\-h> {.b1 flash; .b1 invoke}
bind . <Key\-w> {.b2 flash; .b2 invoke}
\fBbutton\fR .b1 -text Hello -underline 0
\fBbutton\fR .b2 -text World -underline 0
bind . <Key-h> {.b1 flash; .b1 invoke}
bind . <Key-w> {.b2 flash; .b2 invoke}
pack .b1 .b2
.CE
.SH "SEE ALSO"
Expand Down
38 changes: 25 additions & 13 deletions doc/chooseDirectory.n
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'\"
'\" Copyright (c) 1998-2000 by Scriptics Corporation.
'\" Copyright (c) 1998-2000 Scriptics Corporation.
'\" All rights reserved.
'\"
.TH tk_chooseDirectory n 8.3 Tk "Tk Built-In Commands"
Expand All @@ -16,15 +16,19 @@ tk_chooseDirectory \- pops up a dialog box for the user to select a directory.
The procedure \fBtk_chooseDirectory\fR pops up a dialog box for the
user to select a directory. The following \fIoption\-value\fR pairs are
possible as command line arguments:
.\" OPTION: -command
.TP
\fB\-command\fR \fIstring\fR
\fB\-command\fI string\fR
.
Specifies the prefix of a Tcl command to invoke when the user closes the
dialog after having selected an item. This callback is not called if the
user cancelled the dialog. The actual command consists of \fIstring\fR
followed by a space and the value selected by the user in the dialog. This
is only available on Mac OS X.
is only available on macOS.
.\" OPTION: -initialdir
.TP
\fB\-initialdir\fR \fIdirname\fR
\fB\-initialdir\fI dirname\fR
.
Specifies that the directories in \fIdirectory\fR should be displayed
when the dialog pops up. If this parameter is not specified,
the initial directory defaults to the current working directory
Expand All @@ -33,33 +37,41 @@ On Vista and later systems, the initial directory defaults to the last
user-selected directory for the application. If the
parameter specifies a relative path, the return value will convert the
relative path to an absolute path.
.\" OPTION: -message
.TP
\fB\-message\fR \fIstring\fR
\fB\-message\fI string\fR
.
Specifies a message to include in the client area of the dialog.
This is only available on Mac OS X.
This is only available on macOS.
.\" OPTION: -mustexist
.TP
\fB\-mustexist\fR \fIboolean\fR
\fB\-mustexist\fI boolean\fR
.
Specifies whether the user may specify non-existent directories. If
this parameter is true, then the user may only select directories that
already exist. The default value is \fIfalse\fR.
.\" OPTION: -parent
.TP
\fB\-parent\fR \fIwindow\fR
\fB\-parent\fI window\fR
.
Makes \fIwindow\fR the logical parent of the dialog. The dialog
is displayed on top of its parent window. On Mac OS X, this
is displayed on top of its parent window. On macOS, this
turns the file dialog into a sheet attached to the parent window.
.\" OPTION: -title
.TP
\fB\-title\fR \fItitleString\fR
\fB\-title\fI titleString\fR
.
Specifies a string to display as the title of the dialog box. If this
option is not specified, then a default title will be displayed.
.SH EXAMPLE
.PP
.CS
set dir [\fBtk_chooseDirectory\fR \e
\-initialdir ~ \-title "Choose a directory"]
-initialdir ~ -title "Choose a directory"]
if {$dir eq ""} {
label .l \-text "No directory selected"
label .l -text "No directory selected"
} else {
label .l \-text "Selected $dir"
label .l -text "Selected $dir"
}
.CE
.SH "SEE ALSO"
Expand Down
9 changes: 4 additions & 5 deletions doc/colors.n
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'\"
'\" Copyright (c) 1998-2000 by Scriptics Corporation.
'\" Copyright (c) 1998-2000 Scriptics Corporation.
'\" Copyright (c) 2003 ActiveState Corporation.
'\" Copyright (c) 2006-2007 Daniel A. Steffen <[email protected]>
'\" Copyright (c) 2008 Donal K. Fellows
Expand Down Expand Up @@ -782,7 +782,7 @@ YellowGreen 154 205 50
.DE
.SH "PORTABILITY ISSUES"
.TP
\fBMac OS X\fR
\fBmacOS\fR
.
On macOS, the following additional system colors are available. This
first group contains all of the HIBrush colors available in the
Expand Down Expand Up @@ -870,7 +870,7 @@ systemWindowBody
.
Tk supports all of the NSColors in the macOS System ColorList. The
convention for naming these colors is that the Tk name is generated by
capitalizing the macOS name and adding the prefix "system". On OSX
capitalizing the macOS name and adding the prefix "system". On macOS
10.14 (Mojave) and later many of these "semantic" colors will appear
differently depending on whether the NSWindow in which they are used has
the Aqua or DarkAqua appearance. The System ColorList differs between
Expand All @@ -896,7 +896,7 @@ systemTextColor
.
The numbered systemWindowBackgroundColors below
are used in the \fBttk::notebook\fR and \fBttk::labelframe\fR widgets
to provide a contrasting background. Each numbered color constrasts
to provide a contrasting background. Each numbered color contrasts
with its predecessor.
.RS
.DS
Expand All @@ -911,7 +911,6 @@ systemWindowBackgroundColor7
.DE
.RE
.TP

\fBWindows\fR
.
On Windows, the following additional system colors are available
Expand Down
8 changes: 5 additions & 3 deletions doc/cursors.n
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'\"
'\" Copyright (c) 1998-2000 by Scriptics Corporation.
'\" Copyright (c) 1998-2000 Scriptics Corporation.
'\" All rights reserved.
'\"
'\" Copyright (c) 2006-2007 Daniel A. Steffen <[email protected]>
Expand Down Expand Up @@ -101,6 +101,7 @@ The \fBnone\fR cursor can be specified to eliminate the cursor.
.SH "PORTABILITY ISSUES"
.TP
\fBWindows\fR
.
On Windows systems, the following cursors are mapped to native cursors:
.RS
.CS
Expand Down Expand Up @@ -130,8 +131,9 @@ wait
.CE
.RE
.TP
\fBMac OS X\fR
On Mac OS X systems, the following cursors are mapped to native cursors:
\fBmacOS\fR
.
On macOS, the following cursors are mapped to native cursors:
.RS
.CS
arrow
Expand Down
Loading

0 comments on commit 1240b42

Please sign in to comment.