• 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
     
     

  • 相关阅读:
    css-css背景
    css-概述和选择器
    html-补充
    html-示例代码
    html-表格和列表
    html-表单
    html-常用标签
    html- 头部元素
    html-介绍
    SQLAlchemy-对象关系教程ORM-连接,子查询
  • 原文地址:https://www.cnblogs.com/greencolor/p/2147706.html
Copyright © 2020-2023  润新知