File: scrolledwidgetPatch.itk

package info (click to toggle)
tklib 0.9-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 23,156 kB
  • sloc: tcl: 105,088; sh: 2,573; ansic: 792; pascal: 359; makefile: 69; sed: 53; exp: 21
file content (48 lines) | stat: -rw-r--r-- 1,365 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#==============================================================================
# Patch for the iwidgets distribution file scrolledwidget.itk.  It replaces the
# Tk core scrollbars with ttk::scrollbar widgets.
#
# Copyright (c) 2019-2023  Csaba Nemethi (E-mail: csaba.nemethi@t-online.de)
#==============================================================================

itcl::body iwidgets::Scrolledwidget::constructor {args} {
    #
    # Turn off the borderwidth on the hull
    # and save off the interior for later use
    #
    component hull configure -borderwidth 0
    set _interior $itk_interior

    #
    # Check if the scrollbars need mapping upon a configure event
    #
    bind $_interior <Configure> [itcl::code $this _configureEvent]

    #
    # Turn off propagation in the containing shell
    #
    if {[grid propagate $_interior]} {
        grid propagate $_interior no
    }

    #
    # Create the vertical scrollbar
    #
    itk_component add vertsb {
        ttk::scrollbar $itk_interior.vertsb -orient vertical
    } {}

    #
    # Create the horizontal scrollbar
    #
    itk_component add horizsb {
        ttk::scrollbar $itk_interior.horizsb -orient horizontal
    } {}

    #
    # Initialize the widget based on the command line options
    #
    eval itk_initialize $args
}

itcl::configbody iwidgets::Scrolledwidget::sbwidth {}