• Re: ? BUG - Tcl9.0b3 Linux - canvas bind

    From Paul Obermeier@21:1/5 to All on Thu Aug 8 17:47:54 2024
    Am 08.08.2024 um 16:24 schrieb abu:
    Please, can you run this 4-lines script on Linux with TclTk 9.0b3 ?

    Note that it runs as expected with TclTk 9.0b3 on Windows and MacOS, so
    I suspect
    a) my Linux build is wrong
    b) it's a bug only for unix (Linux Ubuntu in my case)

    Any suggestion is appreciated.
    Here's the script


    ## ---------------------------------------------------------------------

    # Test with TclTk 9.0b3
    #   Windows: OK
    #   Linux (Ubuntu): not working (OVAL doesn't change color, no message
    is printed)
    #   MacOS: OK


    pack [canvas .c -background yellow]
    c create oval {20 20 200 200} -fill red  -activefill blue -tag OVAL

    c bind OVAL <Enter> { puts "Entering the OVAL"}
    c bind OVAL <ButtonPress-1> { puts "Clicked inside the OVAL"}

    #  Expected behaviour:
    #    when moving the cursor inside the OVAL
    #      - it turns from red to blue
    #      - a message is printed
    #    when clicking the OVAL
    #      - a message is printed

    # -------------------------------------------------------------

    Works for me on Debian 12.6, SUSE 15.6 and Ubuntu 24.04.

    Paul

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Harald Oehlmann@21:1/5 to All on Thu Aug 8 17:16:15 2024
    Am 08.08.2024 um 16:24 schrieb abu:
    Please, can you run this 4-lines script on Linux with TclTk 9.0b3 ?

    Note that it runs as expected with TclTk 9.0b3 on Windows and MacOS, so
    I suspect
    a) my Linux build is wrong
    b) it's a bug only for unix (Linux Ubuntu in my case)

    Any suggestion is appreciated.
    Here's the script


    ## ---------------------------------------------------------------------

    # Test with TclTk 9.0b3
    #   Windows: OK
    #   Linux (Ubuntu): not working (OVAL doesn't change color, no message
    is printed)
    #   MacOS: OK


    pack [canvas .c -background yellow]
    c create oval {20 20 200 200} -fill red  -activefill blue -tag OVAL

    c bind OVAL <Enter> { puts "Entering the OVAL"}
    c bind OVAL <ButtonPress-1> { puts "Clicked inside the OVAL"}

    #  Expected behaviour:
    #    when moving the cursor inside the OVAL
    #      - it turns from red to blue
    #      - a message is printed
    #    when clicking the OVAL
    #      - a message is printed

    # -------------------------------------------------------------

    may it just happen, that stdout is not shown?
    Perhaps, you have started using "wish".
    Maybe:
    - start with tclsh + package require tk
    - replace the puts by tk_messageBox

    Just an idea...
    Harald

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From greg@21:1/5 to All on Thu Aug 8 17:55:44 2024
    Am 08.08.24 um 16:24 schrieb abu:
    Please, can you run this 4-lines script on Linux with TclTk 9.0b3 ?

    Note that it runs as expected with TclTk 9.0b3 on Windows and MacOS, so
    I suspect
    a) my Linux build is wrong
    b) it's a bug only for unix (Linux Ubuntu in my case)

    Any suggestion is appreciated.
    Here's the script


    ## ---------------------------------------------------------------------

    # Test with TclTk 9.0b3
    #   Windows: OK
    #   Linux (Ubuntu): not working (OVAL doesn't change color, no message
    is printed)
    #   MacOS: OK


    pack [canvas .c -background yellow]
    c create oval {20 20 200 200} -fill red  -activefill blue -tag OVAL

    c bind OVAL <Enter> { puts "Entering the OVAL"}
    c bind OVAL <ButtonPress-1> { puts "Clicked inside the OVAL"}

    #  Expected behaviour:
    #    when moving the cursor inside the OVAL
    #      - it turns from red to blue
    #      - a message is printed
    #    when clicking the OVAL
    #      - a message is printed

    # -------------------------------------------------------------

    #it works for me

    #package require Tk
    pack [canvas .c -background yellow]
    .c create oval {20 20 200 200} -fill red -activefill blue -tag OVAL

    .c bind OVAL <Enter> { puts "Entering the OVAL"}
    .c bind OVAL <ButtonPress-1> { puts "Clicked inside the OVAL"}

    #parray tcl_platform
    #puts [info patchlevel]
    #puts [info nameofexecutable]

    # Linux Debian Sid
    # tcl/tk 9.0b3 from https://gitlab.com/teclabat/tcltk
    # change from red to blue ok
    # tclsh with
    # package require Tk

    if {0} {
    #output 1:
    tcl_platform(byteOrder) = littleEndian
    tcl_platform(engine) = Tcl
    tcl_platform(machine) = x86_64
    tcl_platform(os) = Linux
    tcl_platform(osVersion) = 6.10.3-amd64
    tcl_platform(pathSeparator) = :
    tcl_platform(platform) = unix
    tcl_platform(pointerSize) = 8
    tcl_platform(user) = greg
    tcl_platform(wordSize) = 8
    9.0b3
    /opt/tcltk90/bin/wish90
    Entering the OVAL
    Entering the OVAL
    Clicked inside the OVAL

    #output 2:
    tcl_platform(byteOrder) = littleEndian
    tcl_platform(engine) = Tcl
    tcl_platform(machine) = x86_64
    tcl_platform(os) = Linux
    tcl_platform(osVersion) = 6.10.3-amd64
    tcl_platform(pathSeparator) = :
    tcl_platform(platform) = unix
    tcl_platform(pointerSize) = 8
    tcl_platform(user) = greg
    tcl_platform(wordSize) = 8
    9.0b3
    /opt/tcltk90/bin/tclsh
    Entering the OVAL
    Entering the OVAL
    Clicked inside the OVAL
    }

    Gregor

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Christian Gollwitzer@21:1/5 to All on Fri Aug 9 17:54:31 2024
    Am 08.08.24 um 17:16 schrieb Harald Oehlmann:

    may it just happen, that stdout is not shown?
    Perhaps, you have started using "wish".

    That's a Windows-only issue. On Linux, there is always stdin/out/err
    connected.

    Christian

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)