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.
  • 相关阅读:
    CentOS 7/8修改系统运行级别
    Sketchup 汇总
    [转]Ruby之类的真相
    [转]Ruby之代码块的迷思
    [转]ruby中的异常处理
    [转]ruby中Class的allocate
    [转]ruby中require和load的区别
    [转]ruby之方法查找
    [转]ruby之动态方法
    [转] ruby之对象体系
  • 原文地址:https://www.cnblogs.com/greencolor/p/2083136.html
Copyright © 2011-2022 走看看