Python Forum
I can't hide borders and _ [] X in window. - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: I can't hide borders and _ [] X in window. (/thread-20288.html)



I can't hide borders and _ [] X in window. - storzo - Aug-03-2019

I try using: main.pack(side="top", fill="both", expand=True)
in main window to hide borders and nav minimalize expand and close.
It don't work any suggestion? Think
import tkinter as tk
import pyautogui

class MainWindow():
    def __init__(self, root):
        self.root = root

        self.pole = tk.Label(self.root, text="---------")
        self.pole.place(x=0, y=0)

        self.move()
    def move(self):

         # information uder mouse
        x, y = pyautogui.position()
        pixelColor = pyautogui.screenshot().getpixel((x, y))
        self.pole.config(text="X:" + str(x) + " Y:" + str(y) + "\n R:" + str(pixelColor[0]).rjust(3) + " G:" + str(
            pixelColor[1]).rjust(3) + " B:" + str(pixelColor[2]).rjust(3))
        x = x + 2
        y = y + 1
        loc = "150x45+" + str(x) + "+" + str(y)
        root.geometry(loc)
        root.attributes("-topmost", True, "-toolwindow", True, "-alpha", 0.7)
        root.after(5, self.move)




root = tk.Tk()
main = MainWindow(root)

#main.pack(side="top", fill="both", expand=True)
root.mainloop()



RE: I can't hide borders and _ [] X in window. - Yoriz - Aug-03-2019

Maybe this is what you are looking for:

https://effbot.org/tkinterbook/wm.htm#Tkinter.Wm.overrideredirect-method Wrote:Toplevel Window Methods
This group of methods are used to communicate with the window manager. They are available on the root window (Tk), as well as on all Toplevel instances.

overrideredirect(flag=None)
  • Sets or gets the override redirect flag. If non-zero, this prevents the window manager from decorating the window. In other words, the window will not have a title or a border, and it cannot be moved or closed via ordinary means.



RE: I can't hide borders and _ [] X in window. - storzo - Aug-04-2019

(Aug-03-2019, 10:36 PM)Yoriz Wrote: Maybe this is what you are looking for:

https://effbot.org/tkinterbook/wm.htm#Tkinter.Wm.overrideredirect-method Wrote:Toplevel Window Methods
This group of methods are used to communicate with the window manager. They are available on the root window (Tk), as well as on all Toplevel instances.

overrideredirect(flag=None)
  • Sets or gets the override redirect flag. If non-zero, this prevents the window manager from decorating the window. In other words, the window will not have a title or a border, and it cannot be moved or closed via ordinary means.

can't open page http://prntscr.com/oo3s4x


RE: I can't hide borders and _ [] X in window. - Yoriz - Aug-04-2019

If you don't want to go to the link read the words that I copied from the link.


RE: I can't hide borders and _ [] X in window. - storzo - Aug-04-2019

(Aug-04-2019, 09:10 AM)Yoriz Wrote: If you don't want to go to the link read the words that I copied from the link.

nope m8 answer:
root.overrideredirect(1)
he disable _[]X and borders:D
ty for your advice!

example:
http://prntscr.com/oo46fq