1
# ------------------------------------------------------------------------------
3
# This file is part of Unifix BWidget Toolkit
4
# ------------------------------------------------------------------------------
7
# - Separator::configure
9
# ------------------------------------------------------------------------------
11
namespace eval Separator {
12
Widget::declare Separator {
13
{-background TkResource "" 0 frame}
14
{-relief Enum groove 0 {ridge groove}}
15
{-orient Enum horizontal 1 {horizontal vertical}}
16
{-bg Synonym -background}
18
Widget::addmap Separator "" :cmd {-background {}}
20
proc ::Separator { path args } { return [eval Separator::create $path $args] }
25
# ------------------------------------------------------------------------------
26
# Command Separator::create
27
# ------------------------------------------------------------------------------
28
proc Separator::create { path args } {
29
Widget::init Separator $path $args
31
if { [Widget::getoption $path -relief] == "groove" } {
37
if { [Widget::getoption $path -orient] == "horizontal" } {
39
-background [Widget::getoption $path -background] \
45
-background [Widget::getoption $path -background] \
50
bind $path <Destroy> {Widget::destroy %W; rename %W {}}
52
rename $path ::$path:cmd
53
proc ::$path { cmd args } "return \[eval Separator::\$cmd $path \$args\]"
59
# ------------------------------------------------------------------------------
60
# Command Separator::configure
61
# ------------------------------------------------------------------------------
62
proc Separator::configure { path args } {
63
set res [Widget::configure $path $args]
65
if { [Widget::hasChanged $path -relief relief] } {
66
if { $relief == "groove" } {
67
$path:cmd configure -relief sunken
69
$path:cmd configure -relief raised
77
# ------------------------------------------------------------------------------
78
# Command Separator::cget
79
# ------------------------------------------------------------------------------
80
proc Separator::cget { path option } {
81
return [Widget::cget $path $option]