Re: get default options of Tk widgets
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.tcl archive

Re: get default options of Tk widgets

From: Uwe Klein <uwe_klein_habertwedt@t-online.de>
Date: Sat Apr 29 2006 - 17:26:46 CEST

Hi,
is this what you are looking for?

set widget [ label .l]
set alloptions [ $widget configure ]
set singleoption [ $widget configure -$option ]

foreach item $alloptions {
        foreach {argname optdbname class default current} $item {
                puts "cmdline name : $argname"
                puts "optdbname : $optdbname"
                puts "Class : $class"
                puts "default val : \"$default\""
                puts "current val : \"$current\""
                puts ""
        }
}

set option [ string trimleft $argname - ]
set singleoption [ $widget configure -$option ]

puts "singleoption \"$option\""

foreach {argname optdbname class default current} $singleoption {
        puts "cmdline name : $argname"
        puts "optdbname : $optdbname"
        puts "Class : $class"
        puts "default val : \"$default\""
        puts "current val : \"$current\""
        puts ""
}

uwe
Received on Sun Apr 30 03:31:37 2006