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
2 parents ef857a2 + 1240b42 commit f588a48
Show file tree
Hide file tree
Showing 15 changed files with 369 additions and 222 deletions.
28 changes: 16 additions & 12 deletions doc/busy.n
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,15 @@
.SH NAME
busy \- Make Tk widgets busy, temporarily blocking user interactions
.SH SYNOPSIS
\fBtk busy\fR \fIwindow \fR?\fIoptions\fR?
.sp
.nf
\fBtk busy\fI window \fR?\fIoptions\fR?
\fBtk busy busywindow \fIwindow\fR
.sp
\fBtk busy hold\fR \fIwindow \fR?\fIoptions\fR?
.sp
\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
Expand Down Expand Up @@ -116,7 +112,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 @@ -129,20 +125,23 @@ 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: busywindow
.TP
\fBtk busy busywindow \fIwindow\fR
.
Returns the pathname of the busy window (i.e. the transparent window
shielding the window appearing busy) created by the \fBtk busy hold\fR
command for \fIwindow\fR, or the empty string if \fIwindow\fR is not busy.
.\" METHOD: cget
.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 @@ -169,12 +168,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 @@ -183,6 +184,7 @@ 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 hold \fIwindow\fR ?\fIoption value\fR?...
.
Expand All @@ -197,13 +199,15 @@ command returns the pathname of the busy window that was created (i.e. the
transparent window shielding the window appearing busy). 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 Down Expand Up @@ -260,7 +264,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
24 changes: 16 additions & 8 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 @@ -114,14 +114,18 @@ operations on the widget. It has the following general form:
\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
36 changes: 24 additions & 12 deletions doc/chooseDirectory.n
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 3 additions & 4 deletions doc/colors.n
Original file line number Diff line number Diff line change
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
6 changes: 4 additions & 2 deletions doc/cursors.n
Original file line number Diff line number Diff line change
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 f588a48

Please sign in to comment.