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.
  • 相关阅读:
    redis 集群
    redis--主从复制
    redis--AOF
    React——组件
    React——文件夹分析
    WEB面试
    WEB基础——接收后台文件方法
    WEB基础——AJAX
    C#进阶——IOC
    C#基础——HttpContext
  • 原文地址:https://www.cnblogs.com/greencolor/p/2083136.html
Copyright © 2011-2022 走看看