zoukankan      html  css  js  c++  java
  • itk_option remove

    itk_option remove optName ?optName optName ...?
    Removes one or more options from the composite option list for a mega-widget. Here, optName can have one of the forms described above for the "itk_option add" command.
    Options are normally integrated into the composite option list when a component widget is first created. This method can be used to remove options at a later time. For example, a derived class can override an option defined in a base class by removing and redefining the option:
    itcl::class Base {
        inherit itk::Widget
        constructor {args} {
            eval itk_initialize $args
        }
    
        itk_option define -foo foo Foo "" {
            puts "Base: $itk_option(-foo)"
        }
    }
    
    itcl::class Derived {
        inherit Base
    
        constructor {args} {
            itk_option remove Base::foo
            eval itk_initialize $args
        }
        itk_option define -foo foo Foo "" {
            puts "Derived: $itk_option(-foo)"
        }
    }
    
    Without the "itk_option remove" command, the code fragments for both of the "-foo" options would be executed each time the composite "-foo" option is configured. In the example above, the Base::foo option is suppressed in all Derived class widgets, so only the Derived::foo option remains.
  • 相关阅读:
    九连环
    杨辉三角
    魔术师发牌问题(循环链表)
    Linux 技巧:让进程在后台可靠运行的几种方法
    博客新地址
    x&(-x)取x的最后一个1的证明
    c++对象模型布局分析
    c++ 子类要正确的调用父类构造函数
    hibernate ID 生成方式
    IOCP
  • 原文地址:https://www.cnblogs.com/greencolor/p/2083136.html
Copyright © 2011-2022 走看看