Tk Library Source Code

View Ticket
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.
Ticket UUID: e8bf5556a856e0f56bfd0e12674339f3d09356ab
Title: Get id from ::Plotchart::DrawTimePeriod
Type: Bug Version: 1.3
Submitter: rianby64 Created on: 2017-11-16 12:03:14
Subsystem: tklib :: plotchart Assigned To: nobody
Priority: 5 Medium Severity: Minor
Status: Open Last Modified: 2017-11-16 12:03:14
Resolution: None Closed By: nobody
    Closed on:
Description:
Hello!

I'd like to bind some events to the TimePeriod rectangle. I see the description of the function that draws this time period, and see that it returns none.

# DrawTimePeriod --
#    Draw a period
# Arguments:
#    w           Name of the canvas
#    text        Text to identify the "period" item
#    time_begin  Start time
#    time_end    Stop time
#    colour      The colour to use (optional)
# Result:
#    None
# Side effects:
#    Data bars drawn in canvas
#

And I need to perform things like...
set s [::Plotchart::createTimechart .c "1 january 2004"  "31 december 2004" 4]
set spring [$s period "Spring" "1 march 2004" "1 june 2004" green]
.c bind $spring <ButtonPress> [list handleClick %W %x %y]

By the way, the GanttChart allows me to bind events to the tasks...
set s [::Plotchart::createGanttchart .c "1 january 2004" \
        "1 march 2005" 2]

set spring [$s task "" "1 march 2004" "1 june 2004" 0]
.c bind [lindex $spring 2] <ButtonPress> [list handleClick %W %x %y]