rframe - yet another decorated frame widget

JOB Implements a frame widget with an eye catching frame around (like in modern web applications).

WikiDBImage rframe.png

Source code:

  • rframe.tcl
# rframe.tcl ---
# -------------------------------------------------------------------------
#  Copyright (c) 2009  Johann Oberdorfer, [email protected]
#  This source file is distributed under the BSD license.
#
#  Thank's to Bryan Oakley, who wrote the article https://wiki.tcl-lang.org/20152
#  in 2007 which was very straight forward at a time - where tile was
#  in an early developement stage too. A few years later, I picked up the
#  idea and came along with this approach.
# -------------------------------------------------------------------------
#
# PURPOSE:
#   rfame -- Implements a ttk frame widget with rounded corners.
# -------------------------------------------------------------------------

# Revision history:
# 17-04-11: expand true added

package provide rframe 0.1.1
package require tile


set images(rframe_active) [image create photo -data {
iVBORw0KGgoAAAANSUhEUgAAAMgAAACgCAYAAABJ/yOpAAAAAXNSR0IArs4c6QAAAARnQU1BAACx
jwv8YQUAAAAJcEhZcwAAEbAAABGwAcgn9VQAAAAGYktHRAD/AP8A/6C9p5MAAAAHdElNRQfhAR0J
Dhri7ysOAAASI0lEQVR4Xu2diZMcV33Hv91z7+7srqTVZcmSLAtsLHzIlp2IHM4BsV0hlZRxJaZM
irhIfFChYkgwoVKAg6FwymBSBWUFk0ARAjHECQ4pxwdOjDEWMhaSTx3W7kpa72rv1c7Mzn10ft83
M85qtdv/wHw/VbM70/1ev/P7ju5fv+e95zM/DTwAnv2JxXzki3Uk7H8i5uHRT+5Brd5ANOK/9Z+8
fCKDO/ceQF9PCr7voVRpuOPRiIfdO/rw+Vt2ut9tFko19CSjePzgBD73vcPo604iGvVgXlGuBsjm
S7jt+gvxwd/c6twzLN9rhuXbvy88cgzPvj6LqMUrCAI06vYJ7LrFCr5462XYc9Hqs+JXqtaRjEXw
/gdexEymgkTc4l/jNS2u1QbK5RKe/cJvoWYXiUciLow243Ml3PLlA0gkIi4chkd/1Vod561J4dt3
7XbuFodHDr+Zw5999QDW9idRrASoWBxS8Qjy5Rp+49K1+Nub39Fy2aQdx399bhQPPXUKKctvS5KD
5VG0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UO7DMnbS4Na2jlshMoebixBaTceWHI8VNqxNuo5OlRCyMIUs0V1lla7549Xp+3WZp
4/GlMA1vWuUh7XyJWW9XrbE38LF9w7lpY1hla5G5EgbjGIv6rqV1PZ3pni3TxlXLF1AmX3Vp4354
i4mYR74OvVJlHz9TdD1GOwy2tlUbMzP+2y1tCSuH5eI52BICJ6F8zXpx2V+wwm1+XnPYxMGeuE07
T9kDXXhetwuLvxfnKee3bHxZ2gyHH8aV12PaNq9JmZuz40hmshXkuePAovrBq3LEsnFV8q0XmhbD
tJ2aKtgoyHoMc++O2X/WTV7mghXK2/mzcmOcFhu286vnAf8H1+6tsfdkhbUAAAAASUVORK5CYII=
}]
set images(rframe_normal) [image create photo -data {
iVBORw0KGgoAAAANSUhEUgAAAMgAAACgCAYAAABJ/yOpAAAAAXNSR0IArs4c6QAAAARnQU1BAACx
jwv8YQUAAAAJcEhZcwAAEbAAABGwAcgn9VQAAAAGYktHRAD/AP8A/6C9p5MAAAAHdElNRQfhAR0J
DCeIsQWdAAAOtklEQVR4Xu2d228VRRzHf2drKZdelJbaVq0KKvKE8fakCTzgG5hojInx+ujtQWM0
3pIajYkaQ4Ix8qho1BijEYwPaJTEiKK2WGkVQdpCoS30RksLrRfq+fx2h/b0Mv4B5/tJJrtnd2bn
+t05s/ub2dyTTz45ZXmSJLHzzjvPzpw549vS0lJ78cUX7ezZs34ubKGzs9Nef/11q6io8GN//fWX
H8/lcrZmzRp74IEH/HdgcnLSysrKrLm52d5++21btmyZXx//hB0fH7dNmzbZhg0b3P/MuOD999+3
1tZWW7RokU1NTdk///zjW9L68MMP2+rVqwvCcJ48vPTSS3bq1CmPi2PE9/fff9vExIRt2bLFw+Bv
JkNDQ/byyy97evELhMNvTU2NPfXUU35sdhq7u7vt1VdfteXLl/v1iY/0sn/ttdfaPffck/lMCWnc
tWuX7dix41x5AHkj7o0bN9q6devO+Z3Ju+++ay0tLR4H5cuWNI+MjNjjjz9ul112WeazkNdee80G
BgY8LuLBETfXeO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
7OEchH0aOn99Z4fhNwLm7ggc5xhpx19dXZ3XQ4gfCMedFAGxT17C+bAlbxDSwRa/ob4JE44FP+w3
Nja6n9ntiDKjLINf4ByOXojeh3DBP+lgS+OkrQS/5A+4fnV1tdc3/jgXoMxJI/WA/xCGa+Ko71Av
ISyO9BIuxB22aV5K7D8jaPH/N8lO9QAAAABJRU5ErkJggg==
}]


# -------------------------------------------------------------------------
# -------------------------------------------------------------------------

namespace eval ::rframe:: {
        variable wLocals
        
        array set wLocals [array get images]

        ttk::style element create RoundedFrame image \
                        [list $wLocals(rframe_normal) focus $wLocals(rframe_active)] \
                        -border 4 -width 200 -height 160 -sticky nsew
                                
        ::ttk::style layout \
                        RoundedFrame { RoundedFrame -sticky nsew }
}


proc ::rframe::rframe {w {bg ""} } {

        if {$bg == ""} {
                # set bg "#DFECFF"
                set bg "white"
        }

        ttk::style configure RoundedFrame \
                        -background $bg
        
        # 17-04-11: expand true added
        set f [eval ttk::frame $w -style RoundedFrame]
        pack $f -side top -fill both -padx 4 -pady 4 -expand true
        
          # container frames to ensure required padding
        # to match with rounded frame icons...
        
        set f1 [frame $w.fpad1 -relief flat -bg $bg]
        pack $f1 -side top -fill both -padx 4 -pady 4
        
        set f2 [frame $f1.f2 -relief flat -bg $bg]

        # binding for rframe:
        bind $f2 <Enter> [list $f state focus]
        bind $f2 <Leave> [list $f state !focus]

        return $f2
}
  • rframe_test.tcl
set dir [file dirname [info script]]
lappend auto_path [file join $dir "."]


package require tile
package require rframe


# -------------------------------------------------------------------------
# test
# -------------------------------------------------------------------------

proc main {} {
        
        # -- only required for the demo code
        proc ::rframe::GetTTKOption {optName} {
                set optVal ""
                foreach {opt val} [::ttk::style configure .] {
                        if {$opt eq $optName } {
                                set optVal $val
                                break
                        }
                }
                return $optVal
        }
        
        
        wm withdraw .
        set t [toplevel .test]
        wm geometry $t "200x300"
        
        set f [ttk::frame $t.status]
        pack $f -side bottom -fill x
        
        ttk::label $f.l -text "RoundedFrame test..."
        pack $f.l -side bottom -fill x
        
        set f [ttk::frame $t.main]
        pack $f -side top -fill both -expand true
        
        set rf [::rframe::rframe $f.rf]
        pack $rf -fill both -expand true
        
        text $rf.t \
                        -relief flat -bd 0 \
                        -highlightthickness 0 \
                        -bg "white"
                        
        # -bg #DFECFF" ;# [::rframe::GetTTKOption "-background"]
        
        pack $rf.t -fill both -expand true
        
        
        bind $rf.t <FocusIn>  "$f.rf state focus"
        bind $rf.t <FocusOut> "$f.rf state !focus"
}


main
  • pkgIndex.tcl
# Tcl package index file, version 1.1
# This file is generated by the "pkg_mkIndex" command
# and sourced either when an application starts up or
# by a "package unknown" script.  It invokes the
# "package ifneeded" command to set up package-related
# information so that packages will be loaded automatically
# in response to "package require" commands.  When this
# script is sourced, the variable $dir must contain the
# full path name of this file's directory.

if { ![package vsatisfies [package provide Tcl] 8.4] } { return }
package ifneeded rframe 0.1.1 [list source [file join $dir rframe.tcl]]