I used Tkinter , with several Toplevels, They appear separate in the Ubuntu Taskbar, instead of being together as with the case of say opening multiple firefox windows (i mean they all group under firefox icon together , the required can be selected from it). All the tkinter windows appear separately in task bar and therefore occupy a lot of space in the bar.Is there a way to group them together, so that it is easy to see how many windows are opened currently and look clearly that they are part of a program
-
I believe this has been asked a few times but I have yet to see a solid example of how to make this work. So far I have just seen some references to windows ex style. [Removing windows from the taskbar, Windows 7](https://stackoverflow.com/questions/7128434/removing-windows-from-the-taskbar-windows-7). It would be nice to see if this is actually possible. – Mike - SMT Jun 08 '18 at 13:21
1 Answers
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)

- 1
- 1

- 370,779
- 53
- 539
- 685
-
Thanks Bryan. I was trying to figure out how the `group()` method worked as the resource I found provided no examples. – Mike - SMT Jun 08 '18 at 14:13
-