Making Tkinter Multiple Windows Have One Icon in the Task Bar Making Tkinter Multiple Windows Have One Icon in the Task Bar tkinter tkinter

Making Tkinter Multiple Windows Have One Icon in the Task Bar


The only mechanism tkinter provides is the wm_group method, which provides hints to the window manager that one or more windows belong to a single group. The window manager is free to use or ignore those hints. I don't know if this will have any effect on Ubuntu and whatever window manager you're using.

From the canonical tcl/tk documentation:

wm group window ?pathName?

If pathName is specified, it gives the path name for the leader of a group of related windows. The window manager may use this information, for example, to unmap all of the windows in a group when the group's leader is iconified. PathName may be specified as an empty string to remove window from any group association. If pathName is specified then the command returns an empty string; otherwise it returns the path name of window's current group leader, or an empty string if window is not part of any group.

Example:

root = tk.Tk()w1 = tk.Toplevel(root)w2 = tk.Toplevel(root)w1.group(root)w2.group(root)