Re: Copy constructor in itcl
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: Copy constructor in itcl

From: <amit.zaroo@gmail.com>
Date: Wed Mar 29 2006 - 10:51:21 CEST

Okay I did it and here it is
------------------------------------------------------------------------------
itcl::class visInfo {
        constructor {args} {
           if { [catch {
              if { [$args isa visInfo] } {
                 #Copy Constructor here
                 configure -name "[$args cget -name]"
                 configure -x "[$args cget -x]"
                 configure -y "[$args cget -y ]"
                 configure -fontSize "[$args cget -fontSize]"
                 configure -zorder "[$args cget -zorder]"
              }
           } err] } {
                eval configure $args
           }
        }
        public variable name ""
        public variable x ""
        public variable y
        public variable fontSize ""
        public variable zorder ""
}
--------------------------------------------------------------
let me know if there is a cleaner implementation
Received on Sun Apr 30 02:52:39 2006