Bwidget Source Code
Check-in [224a40daaa]
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:BWidget::set_themedefaults "initialize" added
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 224a40daaa90c87fa57d1106bcffcf82526ddb2e
User & Date: oberdorfer 2009-09-06 20:51:44
Context
2009-09-06
21:00
updated to 1.9.1, themeutils.tcl added, requ. initialization sequence check-in: 2917f5e0c1 user: oberdorfer tags: trunk
20:51
BWidget::set_themedefaults "initialize" added check-in: 224a40daaa user: oberdorfer tags: trunk
20:45
various changes related to ttk added check-in: 478ff3af32 user: oberdorfer tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to init.tcl.







1
2
3
4
5
6
7
..
34
35
36
37
38
39
40







































































namespace eval Widget {}
proc Widget::_opt_defaults {{prio widgetDefault}} {
    if {$::tcl_version >= 8.4} {
	set plat [tk windowingsystem]
    } else {
	set plat $::tcl_platform(platform)
    }
................................................................................
## Add a TraverseIn binding to standard Tk widgets to handle some of
## the BWidget-specific things we do.
bind Entry   <<TraverseIn>> { %W selection range 0 end; %W icursor end }
bind Spinbox <<TraverseIn>> { %W selection range 0 end; %W icursor end }

bind all <Key-Tab>       { Widget::traverseTo [Widget::focusNext %W] }
bind all <<PrevWindow>>  { Widget::traverseTo [Widget::focusPrev %W] }


































































>
>
>
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
..
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# ----------------------------------------------------------------------------
#  init.tcl
#  This file is part of Unifix BWidget Toolkit
#  $Id: init.tcl,v 1.91 2009/09/06 20:51:44 oberdorfer Exp $
# ----------------------------------------------------------------------------
#
namespace eval Widget {}
proc Widget::_opt_defaults {{prio widgetDefault}} {
    if {$::tcl_version >= 8.4} {
	set plat [tk windowingsystem]
    } else {
	set plat $::tcl_platform(platform)
    }
................................................................................
## Add a TraverseIn binding to standard Tk widgets to handle some of
## the BWidget-specific things we do.
bind Entry   <<TraverseIn>> { %W selection range 0 end; %W icursor end }
bind Spinbox <<TraverseIn>> { %W selection range 0 end; %W icursor end }

bind all <Key-Tab>       { Widget::traverseTo [Widget::focusNext %W] }
bind all <<PrevWindow>>  { Widget::traverseTo [Widget::focusPrev %W] }

namespace eval ::BWidget {

    if {[lsearch -exact [font names] "TkTextFont"] < 0} {
        catch {font create TkTextFont}
        catch {font create TkDefaultFont}
        catch {font create TkHeadingFont}
        catch {font create TkCaptionFont}
        catch {font create TkTooltipFont}

        switch -- [tk windowingsystem] {
            "win32" {
                if {$::tcl_platform(osVersion) >= 5.0} {
                    variable family "Tahoma"
                } else {
                    variable family "MS Sans Serif"
                }
                variable size 8

                font configure TkDefaultFont -family $family -size $size
                font configure TkTextFont    -family $family -size $size
                font configure TkHeadingFont -family $family -size $size
                font configure TkCaptionFont -family $family -size $size \
                    -weight bold
                font configure TkTooltipFont -family $family -size $size
            }

            "classic" - "aqua" {
                variable family "Lucida Grande"
                variable size 13
                variable viewsize 12
                variable smallsize 11

                font configure TkDefaultFont -family $family -size $size
                font configure TkTextFont    -family $family -size $size
                font configure TkHeadingFont -family $family -size $smallsize
                font configure TkCaptionFont -family $family -size $size \
                    -weight bold
                font configure TkTooltipFont -family $family -size $viewsize
            }

            "x11" {
                if {![catch {tk::pkgconfig get fontsystem} fs]
                    && [string equal $fs "xft"]} {
                    variable family "sans-serif"
                } else {
                    variable family "Helvetica"
                }
                variable size -12
                variable ttsize -10
                variable capsize -14

                font configure TkDefaultFont -family $family -size $size
                font configure TkTextFont    -family $family -size $size
                font configure TkHeadingFont -family $family -size $size \
                    -weight bold
                font configure TkCaptionFont -family $family -size $capsize \
                    -weight bold
                font configure TkTooltipFont -family $family -size $ttsize
            }
        }
    }
} ; ## namespace eval ::BWidget


BWidget::set_themedefaults "initialize"