head	1.6;
access;
symbols
	core-8-5-9:1.6
	core-8-5-8:1.6
	macosx-cocoa-merge:1.6
	macosx-cocoa-premerge:1.6
	macosx-carbon-freeze:1.6
	core-8-5-7:1.6
	core-8-5-6:1.6
	core-8-6-b1:1.6
	core-8-6-a3:1.6
	core-8-5-5:1.6
	core-8-6-a2:1.6
	core-8-5-4:1.6
	core-8-5-3:1.6
	core-8-6-a1:1.6
	core-8-4-19:1.2
	core-8-5-branch:1.6.0.2
	core-8-5-2:1.6
	core-8-4-18:1.2
	core-8-5-1:1.6
	core-8-4-17:1.2
	core-8-5-0:1.6
	core-8-5-b3:1.5
	core-8-5-b2:1.5
	core-8-4-16:1.2
	core-8-5-b1:1.4
	core-stablilizer-merge:1.4
	core-stabilizer-branch:1.4.0.2
	core-stabilizer-merge:1.6
	core-8-4-15:1.2
	core-8-5-a6:1.4
	core-8-5-a5:1.4
	core-8-4-14:1.2
	core-8-5-a4:1.4
	core-8-4-13:1.2
	core-8-4-12:1.2
	core-8-4-11:1.2
	core-8-5-a3:1.4
	core-8-4-10:1.2
	core-8-4-9-branch:1.2.0.28
	core-8-5-a2:1.3
	core-8-4-9:1.2
	core-8-4-8:1.2
	core-8-4-7:1.2
	core-8-5-a1:1.3
	core-8-4-6:1.2
	core-8-4-5:1.2
	mistachkin-dev-branch:1.3.0.2
	core-8-4-4:1.2
	core-8-4-3:1.2
	core-8-4-branch:1.2.0.26
	core-8-4-2:1.2
	core-8-4-1:1.2
	core-8-3-5:1.2
	core-8-4-0:1.2
	macosx-8-4-merge-2002-08-31-trunk:1.2
	macosx-8-4-premerge-2002-08-31-branch:1.2
	macosx-8-4-premerge-2002-08-31-trunk:1.2
	macosx-8-4-merge-2002-08-30-branch:1.2
	macosx-8-4-merge-2002-08-30-trunk:1.2
	macosx-8-4-merge-2002-08-20-branch:1.2
	macosx-8-4-merge-2002-08-20-trunk:1.2
	core-8-4-b2:1.2
	core-8-4-b1:1.2
	macosx-premerge-6-9-02:1.2
	core-8-4-a4:1.2
	core-8-3-4:1.2
	macosx-8-4-branch:1.2.0.24
	macosx-8-4-branchpoint:1.2
	core-8-4-a3:1.2
	core-8-3-3:1.2
	dgp-privates-into-namespace:1.2.0.22
	tclpro-1-5-0:1.2
	core-8-4-win-speedup:1.2.0.20
	core-8-4-a2:1.2
	tclpro-1-4-1:1.2
	tclpro-1-4-0:1.2
	core-8-3-2:1.2
	ajuba-ajuba2-2-1-base:1.2
	ajuba-ajuba2-2-0:1.2
	core-8-4-a1:1.2
	core-8-3-1-branch:1.2.0.18
	core-8-3-1:1.2
	scriptics-sc-2-0-b5:1.2
	scriptics-sc-2-0-fixed:1.2
	scriptics-sc-2-0-b2:1.2
	scriptics-sc-2-0-b1:1.2
	core-8-3-0:1.2
	core-8-3-b2:1.2
	core-8-3-b1:1.2
	scriptics-sc-1-1:1.2
	scriptics-sc-1-1-b1:1.2
	core-8-2-3:1.2
	scriptics-sc-1-1-branch:1.2.0.16
	scriptics-sc-1-1-base:1.2
	scriptics-sc-1-0:1.2
	scriptics-sc-1-0-branch:1.2.0.14
	scriptics-sc-1-0-base:1.2
	core-8-2-2:1.2
	core-8-2-1:1.2
	scriptics-bc-1-0-b1:1.2
	core-8-2-1-branch:1.2.0.12
	scriptics-tclpro-1-3-0:1.2
	core-8-2-0:1.2
	core-8-2-b3-branch:1.2.0.10
	core-8-2-b3-base:1.2
	scriptics-tclpro-1-3-b4:1.2
	core-8-2-b2:1.2
	scriptics-tclpro-1-3-b3:1.2
	core-8-2-b1:1.2
	scriptics-tclpro-1-3-b2:1.2
	merge-to-mainline-5/21/99:1.2
	scriptics-tclpro-1-3-b2-branch:1.2.0.8
	core-8-1-1:1.2
	scriptics-tclpro-1-3-b1:1.2
	core-8-1-1-base:1.2
	core-8-1-0:1.2
	merge-to-mainline-4-29-99:1.2
	merge-to-mainline-4-23-99:1.2
	core-8-1-branch-old:1.1.0.4
	core-8-0-6-branch:1.2.0.6
	core-8-0-6-base:1.2
	core-8-0-5:1.2
	core-8-1-b3:1.1.4.2
	core-8-1-b2:1.1.4.2
	dev-8-1-stubs-branch:1.1.4.2.0.2
	dev-stubs-branch:1.2.0.4
	scriptics-tclpro-1-2:1.2
	scriptics-tclpro-1-2-b2:1.2
	core-8-1-merge-2/10/99:1.2
	core-8-0-5-branch:1.2.0.2
	core-8-0-5-base:1.2
	scriptics-tclpro-1-2-b1:1.2
	scriptics-tclpro-1-2-a1:1.2
	core-8-1-b1:1.1.4.2
	core-8-0-4:1.2
	core-8-1-a2:1.1.4.1
	core-8-0-2:1.1
	core-8-0-3:1.2;
locks; strict;
comment	@# @;


1.6
date	2007.12.13.15.27.07;	author dgp;	state Exp;
branches;
next	1.5;

1.5
date	2007.10.15.21.06.17;	author dkf;	state Exp;
branches;
next	1.4;

1.4
date	2004.12.21.11.56.35;	author dkf;	state Exp;
branches
	1.4.2.1;
next	1.3;

1.3
date	2003.08.20.23.02.18;	author hobbs;	state Exp;
branches;
next	1.2;

1.2
date	98.09.14.18.23.30;	author stanton;	state Exp;
branches;
next	1.1;

1.1
date	98.04.01.09.54.28;	author rjohnson;	state Exp;
branches
	1.1.4.1;
next	;

1.1.4.1
date	98.09.29.00.25.33;	author stanton;	state Exp;
branches;
next	1.1.4.2;

1.1.4.2
date	98.09.30.02.17.54;	author stanton;	state Exp;
branches;
next	;

1.4.2.1
date	2007.10.16.04.03.54;	author dgp;	state Exp;
branches;
next	;


desc
@@


1.6
log
@merge stable branch onto HEAD
@
text
@# style.tcl --
#
# This demonstration script creates a text widget that illustrates the
# various display styles that may be set for tags.
#
# RCS: @@(#) $Id: style.tcl,v 1.4.2.1 2007/10/16 04:03:54 dgp Exp $

if {![info exists widgetDemo]} {
    error "This script should be run from the \"widget\" demo."
}

package require Tk

set w .style
catch {destroy $w}
toplevel $w
wm title $w "Text Demonstration - Display Styles"
wm iconname $w "style"
positionWindow $w

## See Code / Dismiss buttons
set btns [addSeeDismiss $w.buttons $w]
pack $btns -side bottom -fill x

# Only set the font family in one place for simplicity and consistency

set family Courier

text $w.text -yscrollcommand "$w.scroll set" -setgrid true \
	-width 70 -height 32 -wrap word -font "$family 12"
scrollbar $w.scroll -command "$w.text yview"
pack $w.scroll -side right -fill y
pack $w.text -expand yes -fill both

# Set up display styles

$w.text tag configure bold -font "$family 12 bold italic"
$w.text tag configure big -font "$family 14 bold"
$w.text tag configure verybig -font "Helvetica 24 bold"
$w.text tag configure tiny -font "Times 8 bold"
if {[winfo depth $w] > 1} {
    $w.text tag configure color1 -background #a0b7ce
    $w.text tag configure color2 -foreground red
    $w.text tag configure raised -relief raised -borderwidth 1
    $w.text tag configure sunken -relief sunken -borderwidth 1
} else {
    $w.text tag configure color1 -background black -foreground white
    $w.text tag configure color2 -background black -foreground white
    $w.text tag configure raised -background white -relief raised \
	    -borderwidth 1
    $w.text tag configure sunken -background white -relief sunken \
	    -borderwidth 1
}
$w.text tag configure bgstipple -background black -borderwidth 0 \
	-bgstipple gray12
$w.text tag configure fgstipple -fgstipple gray50
$w.text tag configure underline -underline on
$w.text tag configure overstrike -overstrike on
$w.text tag configure right -justify right
$w.text tag configure center -justify center
$w.text tag configure super -offset 4p -font "$family 10"
$w.text tag configure sub -offset -2p -font "$family 10"
$w.text tag configure margins -lmargin1 12m -lmargin2 6m -rmargin 10m
$w.text tag configure spacing -spacing1 10p -spacing2 2p \
	-lmargin1 12m -lmargin2 6m -rmargin 10m

$w.text insert end {Text widgets like this one allow you to display information in a
variety of styles.  Display styles are controlled using a mechanism
called }
$w.text insert end tags bold
$w.text insert end {.  Tags are just textual names that you can apply to one
or more ranges of characters within a text widget.  You can configure
tags with various display styles.  If you do this, then the tagged
characters will be displayed with the styles you chose.  The
available display styles are:
}
$w.text insert end "\n1. Font." big
$w.text insert end "  You can choose any system font, "
$w.text insert end large verybig
$w.text insert end " or "
$w.text insert end "small" tiny ".\n"
$w.text insert end "\n2. Color." big
$w.text insert end "  You can change either the "
$w.text insert end background color1
$w.text insert end " or "
$w.text insert end foreground color2
$w.text insert end "\ncolor, or "
$w.text insert end both {color1 color2}
$w.text insert end ".\n"
$w.text insert end "\n3. Stippling." big
$w.text insert end "  You can cause either the "
$w.text insert end background bgstipple
$w.text insert end " or "
$w.text insert end foreground fgstipple
$w.text insert end {
information to be drawn with a stipple fill instead of a solid fill.
}
$w.text insert end "\n4. Underlining." big
$w.text insert end "  You can "
$w.text insert end underline underline
$w.text insert end " ranges of text.\n"
$w.text insert end "\n5. Overstrikes." big
$w.text insert end "  You can "
$w.text insert end "draw lines through" overstrike
$w.text insert end " ranges of text.\n"
$w.text insert end "\n6. 3-D effects." big
$w.text insert end {  You can arrange for the background to be drawn
with a border that makes characters appear either }
$w.text insert end raised raised
$w.text insert end " or "
$w.text insert end sunken sunken
$w.text insert end ".\n"
$w.text insert end "\n7. Justification." big
$w.text insert end " You can arrange for lines to be displayed\n"
$w.text insert end "left-justified,\n"
$w.text insert end "right-justified, or\n" right
$w.text insert end "centered.\n" center
$w.text insert end "\n8. Superscripts and subscripts."  big
$w.text insert end " You can control the vertical\n"
$w.text insert end "position of text to generate superscript effects like 10"
$w.text insert end "n" super
$w.text insert end " or\nsubscript effects like X"
$w.text insert end "i" sub
$w.text insert end ".\n"
$w.text insert end "\n9. Margins." big
$w.text insert end " You can control the amount of extra space left"
$w.text insert end " on\neach side of the text:\n"
$w.text insert end "This paragraph is an example of the use of " margins
$w.text insert end "margins.  It consists of a single line of text " margins
$w.text insert end "that wraps around on the screen.  There are two " margins
$w.text insert end "separate left margin values, one for the first " margins
$w.text insert end "display line associated with the text line, " margins
$w.text insert end "and one for the subsequent display lines, which " margins
$w.text insert end "occur because of wrapping.  There is also a " margins
$w.text insert end "separate specification for the right margin, " margins
$w.text insert end "which is used to choose wrap points for lines.\n" margins
$w.text insert end "\n10. Spacing." big
$w.text insert end " You can control the spacing of lines with three\n"
$w.text insert end "separate parameters.  \"Spacing1\" tells how much "
$w.text insert end "extra space to leave\nabove a line, \"spacing3\" "
$w.text insert end "tells how much space to leave below a line,\nand "
$w.text insert end "if a text line wraps, \"spacing2\" tells how much "
$w.text insert end "space to leave\nbetween the display lines that "
$w.text insert end "make up the text line.\n"
$w.text insert end "These indented paragraphs illustrate how spacing " spacing
$w.text insert end "can be used.  Each paragraph is actually a " spacing
$w.text insert end "single line in the text widget, which is " spacing
$w.text insert end "word-wrapped by the widget.\n" spacing
$w.text insert end "Spacing1 is set to 10 points for this text, " spacing
$w.text insert end "which results in relatively large gaps between " spacing
$w.text insert end "the paragraphs.  Spacing2 is set to 2 points, " spacing
$w.text insert end "which results in just a bit of extra space " spacing
$w.text insert end "within a pararaph.  Spacing3 isn't used " spacing
$w.text insert end "in this example.\n" spacing
$w.text insert end "To see where the space is, select ranges of " spacing
$w.text insert end "text within these paragraphs.  The selection " spacing
$w.text insert end "highlight will cover the extra space." spacing
@


1.5
log
@GOOBE work on the widget demo, plus a new demo of text widget peering.
@
text
@d6 1
a6 1
# RCS: @@(#) $Id: style.tcl,v 1.4 2004/12/21 11:56:35 dkf Exp $
@


1.4
log
@Coding style improvements for the widget demo. [FRQ 815118]
@
text
@d6 1
a6 1
# RCS: @@(#) $Id: style.tcl,v 1.3 2003/08/20 23:02:18 hobbs Exp $
d25 4
d30 1
a30 1
	-width 70 -height 32 -wrap word
d37 4
a40 3
$w.text tag configure bold -font {Courier 12 bold italic}
$w.text tag configure big -font {Courier 14 bold}
$w.text tag configure verybig -font {Helvetica 24 bold}
d61 2
a62 2
$w.text tag configure super -offset 4p -font {Courier 10}
$w.text tag configure sub -offset -2p -font {Courier 10}
d71 1
a71 1
$w.text insert end {. Tags are just textual names that you can apply to one
d78 1
a78 1
$w.text insert end "  You can choose any X font, "
d81 1
a81 1
$w.text insert end "small.\n"
@


1.4.2.1
log
@merge updates from HEAD
@
text
@d6 1
a6 1
# RCS: @@(#) $Id: style.tcl,v 1.4 2004/12/21 11:56:35 dkf Exp $
a24 4
# Only set the font family in one place for simplicity and consistency

set family Courier

d26 1
a26 1
	-width 70 -height 32 -wrap word -font "$family 12"
d33 3
a35 4
$w.text tag configure bold -font "$family 12 bold italic"
$w.text tag configure big -font "$family 14 bold"
$w.text tag configure verybig -font "Helvetica 24 bold"
$w.text tag configure tiny -font "Times 8 bold"
d56 2
a57 2
$w.text tag configure super -offset 4p -font "$family 10"
$w.text tag configure sub -offset -2p -font "$family 10"
d66 1
a66 1
$w.text insert end {.  Tags are just textual names that you can apply to one
d73 1
a73 1
$w.text insert end "  You can choose any system font, "
d76 1
a76 1
$w.text insert end "small" tiny ".\n"
@


1.3
log
@	* library/demos/widget:      Redo code view dialog, use named fonts,
	* library/demos/arrow.tcl:   add basic see/dismiss routine with
	* library/demos/bind.tcl:    images for better look & feel
	* library/demos/bitmap.tcl:
	* library/demos/button.tcl:
	* library/demos/check.tcl:
	* library/demos/clrpick.tcl:
	* library/demos/colors.tcl:
	* library/demos/cscroll.tcl:
	* library/demos/ctext.tcl:
	* library/demos/entry1.tcl:
	* library/demos/entry2.tcl:
	* library/demos/entry3.tcl:
	* library/demos/filebox.tcl:
	* library/demos/floor.tcl:
	* library/demos/form.tcl:
	* library/demos/hscale.tcl:
	* library/demos/icon.tcl:
	* library/demos/image1.tcl:
	* library/demos/image2.tcl:
	* library/demos/items.tcl:
	* library/demos/label.tcl:
	* library/demos/labelframe.tcl:
	* library/demos/menu.tcl:
	* library/demos/menubu.tcl:
	* library/demos/paned1.tcl:
	* library/demos/paned2.tcl:
	* library/demos/plot.tcl:
	* library/demos/puzzle.tcl:
	* library/demos/radio.tcl:
	* library/demos/ruler.tcl:
	* library/demos/sayings.tcl:
	* library/demos/search.tcl:
	* library/demos/spin.tcl:
	* library/demos/states.tcl:
	* library/demos/style.tcl:
	* library/demos/text.tcl:
	* library/demos/twind.tcl:
	* library/demos/unicodeout.tcl:
	* library/demos/vscale.tcl:
@
text
@d6 1
a6 1
# RCS: @@(#) $Id: style.tcl,v 1.2 1998/09/14 18:23:30 stanton Exp $
d12 2
@


1.2
log
@Replaced SCCS strings, fixed binary files
@
text
@d6 1
a6 1
# RCS: @@(#) $Id$
d19 3
a21 5
frame $w.buttons
pack $w.buttons -side bottom -fill x -pady 2m
button $w.buttons.dismiss -text Dismiss -command "destroy $w"
button $w.buttons.code -text "See Code" -command "showCode $w"
pack $w.buttons.dismiss $w.buttons.code -side left -expand 1
@


1.1
log
@Initial revision
@
text
@d6 1
a6 1
# SCCS: @@(#) style.tcl 1.8 97/04/18 11:41:47
@


1.1.4.1
log
@initial tk8.1a2 version
@
text
@d6 1
a6 1
# SCCS: @@(#) style.tcl 1.9 97/05/06 13:59:06
@


1.1.4.2
log
@Merged 8.0.3 changes into 8.1
@
text
@d6 1
a6 1
# RCS: @@(#) $Id: style.tcl,v 1.2 1998/09/14 18:23:30 stanton Exp $
@


