CustomTkinter icon indicating copy to clipboard operation
CustomTkinter copied to clipboard

Request : CTkTooltip & CTkScrollbar

Open vednig opened this issue 2 years ago • 13 comments

CTkTooltip

CTkTooltip Features (suggested) :

  • Tooltip with round corners
  • Custom Font Support
  • Customizable Color i.e. fg and bg

CTkScrollbar

CTkScrollbar Features (suggested) :

  • Scrollbar with round corners
  • Customizable Color i.e. fg and bg

vednig avatar Nov 05 '21 20:11 vednig

yes I agree a tooltip widget would be nice maybe using combination of simple label widget and a triangle

IshanJ25 avatar Dec 23 '21 17:12 IshanJ25

I don't think its possible to create a custom tooltip because it must be separate window without any borders or headers and for round corners you would need a transparent window. Because tooltips can leak over the edge of a window.

kDJAO

But a scrollbar should be possible.

TomSchimansky avatar Dec 23 '21 18:12 TomSchimansky

Well that can easily be solved using a pseudo root with directoverflow true, but I am not sure about the rounded corners

IshanJ25 avatar Dec 24 '21 02:12 IshanJ25

it can be done via Toplevel then make it transparent with wm_attribute -transparentcolor and adding ctk_frame in it. and a label. and since canvas background is "white" by default transcolor could be "white"

vednig avatar Dec 25 '21 09:12 vednig

Except for the shadow part. Which I think could be done but is a little difficult

vednig avatar Dec 25 '21 09:12 vednig

TinUI has created scrollbar. May provide a reference. TinUI - GitHub | TinUI.py in function add_scorllbar readme right side is a scrollbar drawn in tkinter.Canvas.

tooltip also, but it is not nice enough.

Smart-Space avatar May 02 '22 09:05 Smart-Space

@Smart-Space You provide a reference to GPL licensed code in a project which uses a CC license

demberto avatar May 08 '22 06:05 demberto

CTkScrollbar is now available: https://github.com/TomSchimansky/CustomTkinter/wiki/CTkScrollbar (with version 4.5.0)

TomSchimansky avatar Jun 23 '22 20:06 TomSchimansky

I've used for one project of mine ttk Tooltip: https://ttkwidgets.readthedocs.io/en/latest/examples/frames/Tooltip.html

felipetesc avatar Jun 24 '22 03:06 felipetesc

@TomSchimansky does the CTkScrollbar also work with frame? Or just textboxes?

IshanJ25 avatar Jun 24 '22 03:06 IshanJ25

It works like a normal tkinter scrollbar, I don't now if a frame is scrollable in tkinter. You can us it for every widget that accepts a yscrollcommand/xscrollcommand.

TomSchimansky avatar Jun 24 '22 08:06 TomSchimansky

Used the CTkScrollbar in my recent Project. It is a nice feature. I am still looking forward to CTkTooltip.

My Project: https://github.com/MSB-s-Projects/Astrologer-s-Stars-GUI

Screenshot: 211187458-22cabd85-586b-4b8a-ae36-8d4cd571d98f

I want to use tooltips in my app, but if I use the default ones, they will look terrible. I was so hoping for CTkTooltip to be released soon.

image

Manobal-Singh-Bagady avatar Jan 08 '23 11:01 Manobal-Singh-Bagady

Regarding tooltip: In the meantime i use Hoovertip() from idlelib.tooltip module, and it looks ok

import tkinter
import customtkinter
from idlelib.tooltip import Hovertip


customtkinter.set_appearance_mode("System")
customtkinter.set_default_color_theme("blue")

app = customtkinter.CTk()  
app.geometry("400x240")

def button_function():
    print("button pressed")

button = customtkinter.CTkButton(master=app, text="Button with Tootip", command=button_function)
button.place(relx=0.5, rely=0.5, anchor=tkinter.CENTER)

buttonquittip=Hovertip(button,"""
    
    i'm the button tooltip!
    another line

    """)

app.mainloop()

bountycortez avatar Jan 14 '23 16:01 bountycortez

Regarding tooltip: In the meantime i use Hoovertip() from idlelib.tooltip module, and it looks ok

import tkinter
import customtkinter
from idlelib.tooltip import Hovertip


customtkinter.set_appearance_mode("System")
customtkinter.set_default_color_theme("blue")

app = customtkinter.CTk()  
app.geometry("400x240")

def button_function():
    print("button pressed")

button = customtkinter.CTkButton(master=app, text="Button with Tootip", command=button_function)
button.place(relx=0.5, rely=0.5, anchor=tkinter.CENTER)

buttonquittip=Hovertip(button,"""
    
    i'm the button tooltip!
    another line

    """)

app.mainloop()

This definitely Looks Interesting. Thanks for this info. @bountycortez

Manobal-Singh-Bagady avatar Jan 31 '23 13:01 Manobal-Singh-Bagady

i use Hoovertip() from idlelib.tooltip module, and it looks ok

Here my impression (Windows 10, Python 3.11)

idlelib tooltip

The style of the tooltip doesn't fit well (and it's not a native Windows style either).

Also, the tooltip window is always placed below the mouse pointer on a fixed horizontal coordinate; this causes problems when the window is displayed at the left, right or bottom edge, as the tooltip may then be (partially) obscured.

Are these issues maybe only observable on Windows? @bountycortez @Manobal-Singh-Bagady

Wolf-SO avatar Jan 31 '23 14:01 Wolf-SO

@Wolf-SO I have only tried the tooltip from tkinter tix library, which has the same issues as you mentioned. I use windows 11 only, so I don't know about the other operating systems. I think @bountycortez might know this.

Manobal-Singh-Bagady avatar Jan 31 '23 14:01 Manobal-Singh-Bagady

I have recognized even more problems.After my mac switches (system driven) into Dark Mode, i can not read any tooltip text anymore.Am 31.01.2023 um 15:25 schrieb Wolf-SO @.***>:

i use Hoovertip() from idlelib.tooltip module, and it looks ok

Here my impression (Windows 10, Python 3.11)

The style of the tooltip doesn't fit well (and it's not a native Windows style either). Also, the tooltip window is always placed below the mouse pointer on a fixed horizontal coordinate; this causes problems when the window is displayed at the left, right or bottom edge, as the tooltip may then be (partially) obscured. Are these issues only observable on Windows?

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

bountycortez avatar Jan 31 '23 17:01 bountycortez

sam problem on my mac (macos monterey) and even more, see direct answer.

but interesting, how did you combine customtkinter and tix? didn't, work for me.

Am 31.01.2023 um 15:34 schrieb Manobal Singh Bagady @.***>:

@Wolf-SO https://github.com/Wolf-SO I have only tried the tooltip from tkinter tix library, which has the same issues as you mentioned. I use windows 11 only, so I don't know about the other operating systems. I think @bountycortez https://github.com/bountycortez might know this.

— Reply to this email directly, view it on GitHub https://github.com/TomSchimansky/CustomTkinter/issues/15#issuecomment-1410467650, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOIOI6MFGZM7N6G4YK2JSXTWVEPITANCNFSM5HOVI4AQ. You are receiving this because you were mentioned.

bountycortez avatar Jan 31 '23 18:01 bountycortez

That's the issue, @bountycortez. That's why I was requesting CTkTooltip because tix is deprecated and doesn't work anymore.

Manobal-Singh-Bagady avatar Jan 31 '23 19:01 Manobal-Singh-Bagady

Given what Tom said about the tooltip not being possible, maybe close this issue. (The scrollbar has been implemented).

There is a workaround for the tooltip at Akascape/CTkToolTip.

Maybe ask the author to create a PR to merge it with customtkinter.

@TomSchimansky - Close as stale (old), not planned (50% not possible), or planned (50% implemented)?

ghost avatar Jul 18 '23 23:07 ghost