summaryrefslogtreecommitdiffstats
path: root/doc/fontchooser.n
diff options
context:
space:
mode:
Diffstat (limited to 'doc/fontchooser.n')
-rw-r--r--doc/fontchooser.n40
1 files changed, 26 insertions, 14 deletions
diff --git a/doc/fontchooser.n b/doc/fontchooser.n
index 02c2d61..4e667e5 100644
--- a/doc/fontchooser.n
+++ b/doc/fontchooser.n
@@ -11,11 +11,11 @@
.SH NAME
fontchooser \- control font selection dialog
.SH SYNOPSIS
+.nf
\fBtk fontchooser\fR \fBconfigure\fR ?\fI\-option value ...\fR?
-.sp
\fBtk fontchooser\fR \fBshow\fR
-.sp
\fBtk fontchooser\fR \fBhide\fR
+.fi
.BE
.SH DESCRIPTION
.PP
@@ -50,24 +50,32 @@ Hide the font selection dialog if it is visible and cause any pending
\fBtk fontchooser\fR \fBshow\fR command to return.
.PP
.SH "CONFIGURATION OPTIONS"
+.\" OPTION: -parent
.TP
\fB\-parent\fR
+.
Specifies/returns the logical parent window of the font selection dialog
(similar to the \fB\-parent\fR option to other dialogs). The font selection
dialog is hidden if it is visible when the parent window is destroyed.
+.\" OPTION: -title
.TP
\fB\-title\fR
+.
Specifies/returns the title of the dialog. Has no effect on platforms where the
font selection dialog does not support titles.
+.\" OPTION: -font
.TP
\fB\-font\fR
+.
Specifies/returns the font that is currently selected in the dialog if it is
visible, or that will be initially selected when the dialog is shown (if
supported by the platform). Can be set to the empty string to indicate that no
font should be selected. Fonts can be specified in any form given by the "FONT
DESCRIPTION" section in the \fBfont\fR manual page.
+.\" OPTION: -command
.TP
\fB\-command\fR
+.
Specifies/returns the command prefix to be called when a font selection has
been made by the user. The command prefix is evaluated at the global level
after having the specification of the selected font appended. On platforms
@@ -77,8 +85,10 @@ evaluation. Can be set to the empty string to indicate that no callback should
be invoked. Fonts are specified by a list of form [3] of the "FONT DESCRIPTION"
section in the \fBfont\fR manual page (i.e. a list of the form
\fI{family size style ?style ...?}\fR).
+.\" OPTION: -visible
.TP
\fB\-visible\fR
+.
Read-only option that returns a boolean indicating whether the font selection
dialog is currently visible. Attempting to set this option results in an error.
@@ -86,6 +96,7 @@ dialog is currently visible. Attempting to set this option results in an error.
.SH "VIRTUAL EVENTS"
.TP
\fB<<TkFontchooserVisibility>>\fR
+.
Sent to the dialog parent whenever the visibility of the font selection dialog
changes, both as a result of user action (e.g. disposing of the dialog via
OK/Cancel button or close box) and of the \fBtk fontchooser\fR
@@ -94,6 +105,7 @@ current visibility of the dialog by querying the \fB\-visible\fR configuration
option.
.TP
\fB<<TkFontchooserFontChanged>>\fR
+.
Sent to the dialog parent whenever the font selection dialog is visible and the
selected font changes, both as a result of user action and of the \fB\-font\fR
configuration option being set. Binding scripts can determine the currently
@@ -142,36 +154,36 @@ to ensure its selected font matches the new value of the named font.
.CS
proc fontchooserDemo {} {
wm title . "Font Chooser Demo"
- \fBtk fontchooser\fR \fBconfigure\fR \-parent .
- button .b \-command fontchooserToggle \-takefocus 0
+ \fBtk fontchooser\fR \fBconfigure\fR -parent .
+ button .b -command fontchooserToggle -takefocus 0
fontchooserVisibility .b
- bind . \fB<<TkFontchooserVisibility>>\fR \\
+ bind . \fB<<TkFontchooserVisibility>>\fR \e
[list fontchooserVisibility .b]
foreach w {.t1 .t2} {
- text $w \-width 20 \-height 4 \-borderwidth 1 \-relief solid
+ text $w -width 20 -height 4 -borderwidth 1 -relief solid
bind $w <FocusIn> [list fontchooserFocus $w]
$w insert end "Text Widget $w"
}
- .t1 configure \-font {Courier 14}
- .t2 configure \-font {Times 16}
+ .t1 configure -font {Courier 14}
+ .t2 configure -font {Times 16}
pack .b .t1 .t2; focus .t1
}
proc fontchooserToggle {} {
\fBtk fontchooser\fR [expr {
- [\fBtk fontchooser\fR \fBconfigure\fR \-visible] ?
+ [\fBtk fontchooser\fR \fBconfigure\fR -visible] ?
"\fBhide\fR" : "\fBshow\fR"}]
}
proc fontchooserVisibility {w} {
- $w configure \-text [expr {
- [\fBtk fontchooser\fR \fBconfigure\fR \-visible] ?
+ $w configure -text [expr {
+ [\fBtk fontchooser\fR \fBconfigure\fR -visible] ?
"Hide Font Dialog" : "Show Font Dialog"}]
}
proc fontchooserFocus {w} {
- \fBtk fontchooser\fR \fBconfigure\fR \-font [$w cget \-font] \\
- \-command [list fontchooserFontSelection $w]
+ \fBtk fontchooser\fR \fBconfigure\fR -font [$w cget -font] \e
+ -command [list fontchooserFontSelection $w]
}
proc fontchooserFontSelection {w font args} {
- $w configure \-font [font actual $font]
+ $w configure -font [font actual $font]
}
fontchooserDemo
.CE