Bwidget Source Code
Check-in [3d735e7800]
Not logged in
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fixed some issues with the new -style flag.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 3d735e7800999fbb0b926b7ccc8b988e6a6bf83e
User & Date: ericm 1999-10-25 23:00:30
Context
1999-10-29
19:00
* font.tcl: Added one new flag: -querysystem. This lets the user control whether the font selector queries the system (via font families) for the list of fonts, or if it uses a preset list of fonts (which is much faster and less likely to crash some systems). check-in: 3e02826d52 user: ericm tags: trunk
1999-10-25
23:00
Fixed some issues with the new -style flag. check-in: 3d735e7800 user: ericm tags: trunk
21:54
* font.tcl: Added support for two new flags: -families and -styles; -families allows you to specify one of all, fixed, or variable, to limit the choice of fonts to those fonts; -styles allows you to specify a list of styles that can be set with the widget (ie, bold, italic, etc).
check-in: 0044eccdb1 user: ericm tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to font.tcl.

34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
...
353
354
355
356
357
358
359

360

361
362
363
364
365
366
367
    }

    proc ::SelectFont { path args } { return [eval SelectFont::create $path $args] }
    proc use {} {}

    variable _families
    variable _styleOff
    array set _styleOff \
	    [list bold normal italic roman underline 0 overstrike 0]
    variable _sizes    {4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24}

    variable _widget
}


# ------------------------------------------------------------------------------
................................................................................
    } else {
        set font [list $data(family) $data(size)]
    }
    foreach st $_styles {
        if { $data($st) } {
            lappend font $st
        } else {

	    lappend font $_styleOff($st)

	}
    }
    Widget::setoption "$path#SelectFont" -font $font
    if { $type == "dialog" } {
        $data(label) configure -font $font
        $path:cmd configure -cursor $curs
    } elseif { [set cmd [Widget::getoption "$path#SelectFont" -command]] != "" } {






<
|







 







>
|
>







34
35
36
37
38
39
40

41
42
43
44
45
46
47
48
...
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
    }

    proc ::SelectFont { path args } { return [eval SelectFont::create $path $args] }
    proc use {} {}

    variable _families
    variable _styleOff

    array set _styleOff [list bold normal italic roman]
    variable _sizes    {4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24}

    variable _widget
}


# ------------------------------------------------------------------------------
................................................................................
    } else {
        set font [list $data(family) $data(size)]
    }
    foreach st $_styles {
        if { $data($st) } {
            lappend font $st
        } else {
	    if { [info exists _styleOff($st)] } {
		lappend font $_styleOff($st)
	    }
	}
    }
    Widget::setoption "$path#SelectFont" -font $font
    if { $type == "dialog" } {
        $data(label) configure -font $font
        $path:cmd configure -cursor $curs
    } elseif { [set cmd [Widget::getoption "$path#SelectFont" -command]] != "" } {