Tk Library Source Code

View Ticket
Login
Ticket UUID: 3dee7d95ca4d14a112a2081858b26c2afce3b504
Title: Gradient items should be lowered
Type: Bug Version: 0.1
Submitter: arjenmarkus Created on: 2013-10-06 08:13:13
Subsystem: (unused) Assigned To: aku
Priority: 5 Medium Severity: Important
Status: Closed Last Modified: 2013-10-30 18:23:57
Resolution: Fixed Closed By: aku
    Closed on: 2013-10-30 18:23:57
Description:
The example below exhibits the problem:

# grad.tcl --
#     Show a gradient on the canvas
#
package require canvas::gradient
canvas .c
canvas::gradient .c -direction x -color1 yellow -color2 blue
pack .c -fill both -expand 1
set poly [.c create polygon 200 100 300 200 200 300 200 100 -fill blue]

The polygon is not visible - the gradient is drawn on top of it.

This can be remedied by lowering the gradient items:

.c lower canvas::gradient
User Comments: aku added on 2013-10-30 18:23:57:
The cause of the problem is that the actual gradient items are created late, in response to <Configure> events.

Fixed in [5c19b0d0e3]. Version bumped to 0.2.
Committed.
Pushed.

anonymous (claiming to be patch:) added on 2013-10-07 19:57:12:
@@ -123,8 +123,11 @@
     ## with canvas-'create line', 'create oval'. Computed jump to the
     ## actual drawing command.
 
     Draw_$direction
+
+    ## Lowering the gradient items
+    $canvas lower canvas::gradient
     return
 }
 
 # ### ### ### ######### ######### #########
@@ -270,6 +273,6 @@
 
 # ### ### ### ######### ######### #########
 ## Ready
 
-package provide canvas::gradient 0.1
+package provide canvas::gradient 0.2
 return