TkCanvas TkcPolygon state disability


(Phlip) #1

Rubies:

Run this:

#!/usr/bin/env ruby

require “tk”

def main

    top = TkRoot.new

    canvas  = TkCanvas.new (top)

    canvas.grid 'row'=>0,  'column'=>0
                                
    canvas.configure 'background' => '#888888',
                                     'width' => 200,
                                     'height' => 200 * 2 / 3

    shape = [30, 30, 30, 60, 60, 30 ] 

    poly1 = TkcPolygon.new(canvas, shape) { 
        fill 'green'
         outline 'white'
         disabledoutline ''
         width 3
         state 'normal'
         }
    poly2 = TkcPolygon.new(canvas, shape) { 
        fill 'red' 
         outline 'white'
         disabledoutline ''
         width 3
         state 'disabled'
        }
    poly2.move 60, 70
    
    top.bind ('KeyPress-Return') {
        poly1.configure 'state' => 'disabled'
        poly2.configure 'state' => 'normal'
        }

    Tk.mainloop

end

Under Ruby 1.6.6 and its Tk, both triangles come up with white outlines.
The disabled emphasis does not display. If you tap Return both triangles
still appear enabled.

My work-around configures the outline itself - either ‘white’ or ‘’. It
would be nice if these advanced features worked, but I’m unaware if they
work in Tkinter or Tcl/Tk either.

···


Phlip
http://www.greencheese.org/YaAw
– “The Epiphany of the Epiphenomenon of the Epiphysis”
- some jerk-off maliciously pretending to be Henry Miller –