Tk Source Code

Check-in [f91b7065]
Login

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

Overview
Comment:Correct expansion of the spinbox textarea for the vista theme.

The spinbox textarea should stretch to fill the widget and does so with all except the vista theme. Added a test to check for this expansion to avoid regression.

Fix identified Kumba on StackOverflow ( https://stackoverflow.com/a/36393680/291641 )

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | core-8-5-branch
Files: files | file ages | folders
SHA1: f91b7065bf1bf655eec62f5d70dc844a1079ea73
User & Date: patthoyts 2016-09-22 13:42:38
Context
2016-09-27
09:58
Fix [720879afe9] - WM_CHAR message handling. Patch from Christian Werner backported from http://www.androwish.org/index.html/info/a0da5845594cec28 check-in: 6296323f user: jan.nijtmans tags: core-8-5-branch
2016-09-22
13:44
Merge core-8-5-branch to core-8-6-branch. check-in: 25b5e86c user: patthoyts tags: core-8-6-branch
13:42
Correct expansion of the spinbox textarea for the vista theme.

The spinbox textarea should stretch to fill the widget and does so with all except the vista theme. Added a test to check for this expansion to avoid regression.

Fix identified Kumba on StackOverflow ( https://stackoverflow.com/a/36393680/291641 ) check-in: f91b7065 user: patthoyts tags: core-8-5-branch

2016-09-21
23:41
[3126428] Repaint ttk labels and buttons when the image is changed.

In Tk the images associated with labels and buttons have their image changed callback set to cause the widget to be redrawn if the image is changed in any way. However, this has not been done for the ttk equivalent widgets. check-in: 70a23e85 user: patthoyts tags: core-8-5-branch

Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to library/ttk/vistaTheme.tcl.

129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
            -padding 1 -halfheight 1 \
            -syssize { SM_CXVSCROLL SM_CYVSCROLL }
        ttk::style layout TSpinbox {
            Spinbox.field -sticky nswe -children {
                Spinbox.background -sticky news -children {
                    Spinbox.padding -sticky news -children {
                        Spinbox.innerbg -sticky news -children {
                            Spinbox.textarea -expand 1 -sticky {}
                        }
                    }
                    Spinbox.uparrow -side top -sticky ens
                    Spinbox.downarrow -side bottom -sticky ens
                }
            }
        }







|







129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
            -padding 1 -halfheight 1 \
            -syssize { SM_CXVSCROLL SM_CYVSCROLL }
        ttk::style layout TSpinbox {
            Spinbox.field -sticky nswe -children {
                Spinbox.background -sticky news -children {
                    Spinbox.padding -sticky news -children {
                        Spinbox.innerbg -sticky news -children {
                            Spinbox.textarea -expand 1
                        }
                    }
                    Spinbox.uparrow -side top -sticky ens
                    Spinbox.downarrow -side bottom -sticky ens
                }
            }
        }

Changes to tests/ttk/spinbox.test.

194
195
196
197
198
199
200





















201
202
203
204
205
206
207
} -body {
    .sb current 2
    .sb set "z"
    .sb current
} -cleanup {
    destroy .sb
} -result -1






















# nostomp: NB intentional difference between ttk::spinbox and tk::spinbox;
# see also #1439266
#
test spinbox-nostomp-1 "don't stomp on -variable (init; -from/to)" -body {
    set SBV 55
    ttk::spinbox .sb -textvariable SBV -from 0 -to 100 -increment 5







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
} -body {
    .sb current 2
    .sb set "z"
    .sb current
} -cleanup {
    destroy .sb
} -result -1

test spinbox-3.0 "textarea should expand to fill widget" -setup {
    set SBV 5
    set ::spinbox_test {}
    ttk::spinbox .sb -from 0 -to 10 -textvariable SBV
} -body {
    grid .sb -sticky ew
    grid columnconfigure . 0 -weight 1
    bind . <Map> {
        after idle {
            wm geometry . "210x80"
            after 100 {set ::spinbox_test [.sb identify element 5 5]}
        }
        bind . <Map> {}
    }
    after 500 {set ::spinbox_wait 1} ; vwait ::spinbox_wait
    set ::spinbox_test
} -cleanup {
    destroy .sb
    unset -nocomplain ::spinbox_test SBV
} -result {textarea}

# nostomp: NB intentional difference between ttk::spinbox and tk::spinbox;
# see also #1439266
#
test spinbox-nostomp-1 "don't stomp on -variable (init; -from/to)" -body {
    set SBV 55
    ttk::spinbox .sb -textvariable SBV -from 0 -to 100 -increment 5