zoukankan      html  css  js  c++  java
  • configbody conifgure variable in batch

      class sampleconf {
          # a sample class with a single public variable
          public method setpulicv;
          public variable publicvab ;# this var is adjusted using the configure -publicv...
          constructor {} {
          }
      }
     
      body sampleconf::setpulicv { cn } {
      set publicvab $cn;
      puts $publicvab;
      }

      # add a configbody for publicv
      configbody sampleconf::publicvab   {
             puts $publicvab
      set ab [lappend publicvab "aaaa" ]
      puts $ab
      }
     
      # create a sample instance of the class:

      set btn [sampleconf  h2]
     
      h2 setpulicv "A value which is not sent via the configbody"
      # change the publicv again by configure and again you see a message box.

      h2 configure -publicvab "A new Value"
       # change the publicv by configure and you see a message box.
     
      h2 configure -publicvab "The same old Value"
     
      h2 configure -publicvab "Another Value"
     
      h2 setpulicv "A value which is not sent via the configbody"
     
      set aaa [h2 cget -publicvab]
      puts $aaa
     
     

  • 相关阅读:
    hibernate理解
    struts理解
    网上书城项目
    编码过程中遇到的问题
    JS回调函数
    requirejs 一个拆分js项目的类库
    jq插件开发总结
    转载-- 魔兽哈希算法封装和测试
    转载--C# PLINQ 内存列表查询优化历程
    Oracle删除死锁进程的方法
  • 原文地址:https://www.cnblogs.com/greencolor/p/2147706.html
Copyright © 2011-2022 走看看