Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: d1ba1c9c4703960be7761b4a80b36e69cc28c964c4efa0d0ae8a91179c967c1d
Ticket: 4ef142a41aa53e6a32ded9c16e7dfbfaeef2dd6d
Tcl odd if statement syntax doesn't always work.
User & Date: bll on 2018-09-03 20:17:43
Changes

  1. icomment:
    I don't think the instate command is failing, I think it is
    the "expr {return}" that is not (sometimes) working.
    
    
    I have a wrapper around a ttk::combobox.
    
    In the ttk::combobox code, the 'Post' procedure, the following statement
    with the return works for a normal ttk::combobox:
    
    puts "AAA:[$cb cget -state] / [$cb instate disabled]"
    puts "BBB:[$cb state] / [$cb instate disabled]"
        $cb instate disabled  { return }
    puts "   post"
    
    Output when using my wrapper:
    
    AAA:disabled / 1
    BBB:disabled hover / 1
       post 
    
    If I change it to:
    
       if { [$cb instate disabled] } { return }
    
    it does work.
    
  2. login: "bll"
  3. mimetype: "text/plain"