Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7398941
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T03:56:18+00:00 2026-05-29T03:56:18+00:00

I can’t get tooltip to work with my always on top window. Obviously the

  • 0

I can’t get tooltip to work with my always on top window. Obviously the problem is you can’t create something on top of something that’s always on top; so i was wondering if there was a workaround or solution. The Popup needs to be always on top of other windows, but i also need to have all the tooltips show up properly.

Here’s a stripped down version of what I have so far:

from Tkinter import *

class GUI:
    def __init__(self, root):
        Popup = Toplevel(root)
        Popup.resizable(0,0)
        Popup.attributes("-toolwindow", 1)
        Popup.wm_attributes("-topmost", 1)
        PFrame = Frame(Popup)
        self.B = Button(PFrame, width=10,height=10)
        self.B.pack()
        self.createToolTip(self.B,"Click this button.")
        PFrame.pack()

    class ToolTip(object):
        def __init__(self, widget):
            self.widget = widget
            self.tipwindow = None
            self.id = None
            self.x = self.y = 0
        def showtip(self, text):
            self.text = text
            if self.tipwindow or not self.text: return
            x,y,cx,cy = self.widget.bbox("insert")
            x = x + self.widget.winfo_rootx() +15
            y = y + cy + self.widget.winfo_rooty() +65
            self.tipwindow = tw = Toplevel(self.widget)
            tw.wm_overrideredirect(1)
            tw.wm_geometry("+%d+%d"%(x,y))
            label = Label(tw, text=self.text, justify=LEFT)
            label.pack(ipadx=1)
        def hidetip(self):
            tw = self.tipwindow
            self.tipwindow = None
            if tw: tw.destroy()
    def createToolTip(self,widget,text):
        toolTip = self.ToolTip(widget)
        def enter(event): self.tt = root.after(1500,show,event)
        def show(event): toolTip.showtip(text)
        def leave(event):
            if self.tt: root.after_cancel(self.tt)
            toolTip.hidetip()        
        widget.bind('<Enter>', enter)
        widget.bind('<Leave>', leave)

if __name__ == '__main__':
    root = Tk()
    App = GUI(root)
    root.mainloop()
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T03:56:20+00:00Added an answer on May 29, 2026 at 3:56 am

    I fixed it by adding tw.wm_attributes("-topmost", 1) to the showtip function. Let me know if this solution is incorrect or if there is a better way.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can i get the source code for a WAMP stack installer somewhere? Any help
Can somebody point me to a resource that explains how to go about having
Can a LINQ enabled app run on a machine that only has the .NET
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
Can some one Guide me to work with these things... What is Model popup
Can somebody give me advice on how to create a recursive version of GetEnumerator()?
can anyone tell me why this doesn't work? db = openOrCreateDatabase(database.db, SQLiteDatabase.CREATE_IF_NECESSARY, null); db.setLocale(Locale.getDefault());
Can't work out a way to make an array of buttons in android. This
Can anyone help me with an excel formula that groups related rows and creates
Can you have submenus with the top level set to checkable in WPF? I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.