Posted to tcl by patthoyts at Thu May 08 21:52:11 GMT 2008view pretty

namespace eval xyzzy {
    ::ttk::style layout ChoosefontFrame {
        Entry.field -sticky news -border true -children {
            ChoosefontFrame.padding -sticky news
        }
    }
    bind [winfo class .] <<ThemeChanged>> \
        [list ttk::style layout ChoosefontFrame \
             [ttk::style layout ChoosefontFrame]]
}

# ::xyzzy::ttk_listbox --
#
#	Create a properly themed scrolled listbox.
#	This is exactly right on XP but may need adjusting on other platforms.
#
proc ::xyzzy::ttk_slistbox {w args} {
    set f [ttk::frame $w -style ChoosefontFrame -padding 2]
    if {[catch {
        listbox $f.list -relief flat -highlightthickness 0 -borderwidth 0 {*}$args
        ttk::scrollbar $f.vs -command [list $f.list yview]
        $f.list configure -yscrollcommand [list $f.vs set]
        grid $f.list $f.vs -sticky news
        grid rowconfigure $f 0 -weight 1
        grid columnconfigure $f 0 -weight 1
        interp hide {} $w
        interp alias {} $w {} $f.list
    } err]} {
        destroy $f
        return -code error $err
    }
    return $w
}