Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add IDLE Hovertip foreground color needed for recent macOS #120083

Closed
Labels
topic-IDLEtype-bugAn unexpected behavior, bug, or error
@JRiggles

Description

@JRiggles

Bug report

Bug description:

Minimal Reproducible Example

importtkinterastkfromidlelib.tooltipimportHovertiproot=tk.Tk()root.geometry('200x100')label=tk.Label(root,text='Hover Me!')label.pack()tip=Hovertip(label,text='Pro Tip')root.mainloop()

CleanShot 2024-06-04 at 20 04 12@2x

Proposed Fix

Specifying a foreground color, e.g.foreground="black", at theLabel declaration inHovertip.showcontents() fixes the issue

classHovertip(OnHoverTooltipBase):"A tooltip that pops up when a mouse hovers over an anchor widget."def__init__(self,anchor_widget,text,hover_delay=1000):"""Create a text tooltip with a mouse hover delay.        anchor_widget: the widget next to which the tooltip will be shown        hover_delay: time to delay before showing the tooltip, in milliseconds        Note that a widget will only be shown when showtip() is called,        e.g. after hovering over the anchor widget with the mouse for enough        time.        """super().__init__(anchor_widget,hover_delay=hover_delay)self.text=textdefshowcontents(self):label=Label(self.tipwindow,text=self.text,justify=LEFT,foreground="black",background="#ffffe0",relief=SOLID,borderwidth=1)label.pack()

CleanShot 2024-06-04 at 20 08 07@2x

CPython versions tested on:

3.12

Operating systems tested on:

macOS

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic-IDLEtype-bugAn unexpected behavior, bug, or error

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp