• MacOS transparency issues on Tcl/Tk 9.x

    From ajkessel@[email protected] to comp.lang.tcl on Tue Jun 16 11:37:36 2026
    From Newsgroup: comp.lang.tcl


    I've been testing the Python customtkinter active fork custom2kinter with Tcl 9.x. The biggest issue I've encountered is the changes to transparency on MacOS. On 8.6, I was able to create tooltip widgets that looked fine across platforms. On 9.0, rounded tooltips are ugly because the edges are white rather than transparent. I have comparison screenshots here: https://github.com/FedericoSpada/Custom2kinter/issues/3#issuecomment-4712194269 .

    I understand this comes from an intentional design decision for 9.x to implement stricter compliance with NSView/CALayer on MacOS. But I haven't been able to find any workaround to achieve a similar tooltip experience on MacOS as with 8.6. It also appears nearly impossible to use Cocoa native tooltips given Tcl's architectural differences from MacOS native GUIs.

    Have others encountered this issue? Any suggestions for workarounds or fixes? --- Synchronet 3.22a-Linux NewsLink 1.2
  • From saito@[email protected] to comp.lang.tcl on Tue Jun 16 12:39:04 2026
    From Newsgroup: comp.lang.tcl

    On 6/16/2026 7:37 AM, ajkessel wrote:

    I've been testing the Python customtkinter active fork custom2kinter with Tcl 9.x. The biggest issue I've encountered is the changes to transparency on MacOS. On 8.6, I was able to create tooltip widgets that looked fine across platforms. On 9.0, rounded tooltips are ugly because the edges are white rather than transparent. I have comparison screenshots here: https://github.com/FedericoSpada/Custom2kinter/issues/3#issuecomment-4712194269 .

    ...

    Have others encountered this issue? Any suggestions for workarounds or fixes?


    Is the problem only with tooltips? How did you implement your tooltips?
    If it is like buttons, you could get an image that looks like a tooltip
    but where the rounded edges are set to be transparent. I think that
    should work.


    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From ajkessel@[email protected] to comp.lang.tcl on Tue Jun 16 12:54:52 2026
    From Newsgroup: comp.lang.tcl

    On 6/16/2026 12:39 PM, saito wrote:
    I've been testing the Python customtkinter active fork custom2kinter
    with Tcl 9.x. The biggest issue I've encountered is the changes to
    transparency on MacOS. On 8.6, I was able to create tooltip widgets
    that looked fine across platforms. On 9.0, rounded tooltips are ugly
    because the edges are white rather than transparent. I have comparison
    screenshots here: https://github.com/FedericoSpada/Custom2kinter/
    issues/3#issuecomment-4712194269 .
    Is the problem only with tooltips? How did you implement your tooltips?
    If it is like buttons, you could get an image that looks like a tooltip
    but where the rounded edges are set to be transparent. I think that
    should work.

    I'm only seeing it with tooltips so far but have just started
    experimenting with 9.x + customtkinter. Here is the newly released
    tooltip code: https://github.com/ajkessel/Custom2kinter/blob/master/customtkinter/windows/widgets/ctk_tooltip.py

    The tooltip is a CTkFloatingFrame, which is a type of CTkFrame, which is
    a CTkWidget, which is a tkinter.Frame. Is the fundamental issue that
    this is all descending from a tkinter.Frame rather than a tkinter.Button?
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From saito@[email protected] to comp.lang.tcl on Tue Jun 16 13:16:54 2026
    From Newsgroup: comp.lang.tcl

    On 6/16/2026 12:54 PM, ajkessel wrote:
    On 6/16/2026 12:39 PM, saito wrote:

    I'm only seeing it with tooltips so far but have just started
    experimenting with 9.x + customtkinter. Here is the newly released
    tooltip code: https://github.com/ajkessel/Custom2kinter/blob/master/ customtkinter/windows/widgets/ctk_tooltip.py

    The tooltip is a CTkFloatingFrame, which is a type of CTkFrame, which is
    a CTkWidget, which is a tkinter.Frame. Is the fundamental issue that
    this is all descending from a tkinter.Frame rather than a tkinter.Button?


    I am not familiar with CTK/Custom2K and don't have a Mac so...

    I would still try the image trick; it may work.

    You may also want to look into the "wm" command, specifically its
    "-alpha" and its transparency related options. If it stems from a frame ultimately, these options may prove useful.

    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From ajkessel@[email protected] to comp.lang.tcl on Tue Jun 16 15:07:26 2026
    From Newsgroup: comp.lang.tcl

    On 6/16/2026 1:16 PM, saito wrote:
    I'm only seeing it with tooltips so far but have just started
    experimenting with 9.x + customtkinter. Here is the newly released
    tooltip code: https://github.com/ajkessel/Custom2kinter/blob/master/
    customtkinter/windows/widgets/ctk_tooltip.py

    The tooltip is a CTkFloatingFrame, which is a type of CTkFrame, which
    is a CTkWidget, which is a tkinter.Frame. Is the fundamental issue
    that this is all descending from a tkinter.Frame rather than a
    tkinter.Button?
    I am not familiar with CTK/Custom2K and don't have a Mac so...

    I would still try the image trick; it may work.

    Isn't this going to have the same problem? If I create an RGBA image
    with genuinely transparent corner pixels with pillow, displaying it in a tkinter widget doesn't make those pixels show through to the desktop.
    The transparent pixels in the image would just reveal the widget/window background behind them — still white or black, not the desktop.


    You may also want to look into the "wm" command, specifically its "-
    alpha" and its transparency related options. If it stems from a frame ultimately, these options may prove useful.

    Yes, that is how it worked with 8.6 but I can't get a good result with
    9.x. Setting "-transparency" to "true" with "wm" seems to have no
    effect. I can set "-alpha" but then not only is the widget transparent
    but the text in the tooltip is not really legible.
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From ajkessel@[email protected] to comp.lang.tcl on Tue Jun 16 20:29:48 2026
    From Newsgroup: comp.lang.tcl

    On 6/16/2026 3:07 PM, ajkessel wrote:
    On 6/16/2026 1:16 PM, saito wrote:
    I'm only seeing it with tooltips so far but have just started
    experimenting with 9.x + customtkinter. Here is the newly released
    tooltip code: https://github.com/ajkessel/Custom2kinter/blob/master/
    customtkinter/windows/widgets/ctk_tooltip.py

    The tooltip is a CTkFloatingFrame, which is a type of CTkFrame, which
    is a CTkWidget, which is a tkinter.Frame. Is the fundamental issue
    that this is all descending from a tkinter.Frame rather than a
    tkinter.Button?
    I am not familiar with CTK/Custom2K and don't have a Mac so...

    I would still try the image trick; it may work.

    Isn't this going to have the same problem? If I create an RGBA image
    with genuinely transparent corner pixels with pillow, displaying it in a tkinter widget doesn't make those pixels show through to the desktop.
    The transparent pixels in the image would just reveal the widget/window background behind them — still white or black, not the desktop.

    You may also want to look into the "wm" command, specifically its "-
    alpha" and its transparency related options. If it stems from a frame
    ultimately, these options may prove useful.

    Yes, that is how it worked with 8.6 but I can't get a good result with
    9.x. Setting "-transparency" to "true" with "wm" seems to have no
    effect. I can set "-alpha" but then not only is the widget transparent
    but the text in the tooltip is not really legible.
    I've figured out a fix that seems stable, detailed in my comments here https://github.com/FedericoSpada/Custom2kinter/issues/3

    The trick is to use MacOS stylemask fullsizecontent for the frame
    widget, e.g.:

    self._toplevel.wm_attributes(stylemask=('fullsizecontent','titled'))
    self._toplevel.title("")
    self._theme_ff_info["corner_radius"] = 0
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Harald Oehlmann@[email protected] to comp.lang.tcl on Wed Jun 17 08:23:38 2026
    From Newsgroup: comp.lang.tcl

    Am 16.06.2026 um 13:37 schrieb ajkessel:

    I've been testing the Python customtkinter active fork custom2kinter with Tcl 9.x. The biggest issue I've encountered is the changes to transparency on MacOS. On 8.6, I was able to create tooltip widgets that looked fine across platforms. On 9.0, rounded tooltips are ugly because the edges are white rather than transparent. I have comparison screenshots here: https://github.com/FedericoSpada/Custom2kinter/issues/3#issuecomment-4712194269 .

    I understand this comes from an intentional design decision for 9.x to implement stricter compliance with NSView/CALayer on MacOS. But I haven't been able to find any workaround to achieve a similar tooltip experience on MacOS as with 8.6. It also appears nearly impossible to use Cocoa native tooltips given Tcl's architectural differences from MacOS native GUIs.

    Have others encountered this issue? Any suggestions for workarounds or fixes?

    Adam,
    as no real MAC-OS user answered here, I recommend to escalate the issue
    and author a ticket on tk:

    Go here:
    https://core.tcl-lang.org/tk/login

    Login as anonymous
    (if you have no login)

    Go to the tickets tab

    Click on "new"

    Try to put all information you have.
    We don't have many people with tkinter knowledge, but at the end, it all
    calls tcl code and that is understood.

    Sorry,
    Harald
    --- Synchronet 3.22a-Linux NewsLink 1.2