2

When running a Tcl/Tk program in gnome-shell, all toplevels created by the application add an icon to the dash. When hovering over these icons, they all pop up a tooltip saying "Toplevel", which is not very helpful.

The wm title and wm iconname commands have no effect on the displayed tooltip. Apparently the tooltip shows the toplevel's database class value. Indeed, providing a -class option to the toplevel command does affect the tooltip.

However, this has some limitations. I believe it is not customary to have white space in a class name. Also it is not possible to modify the -class option after the widget has been created.

Is there a better way to control the string displayed in the dash tooltip?

Donal Fellows
  • 133,037
  • 18
  • 149
  • 215
Schelte Bron
  • 4,113
  • 1
  • 7
  • 13
  • Can you show a minimal example of how you're creating that GUI? If I do `echo 'button .b -text "Click me" -command exit; pack .b' | wish`, then the dock icon's tooltip is "Wish" (Ubuntu 18.04) – glenn jackman Sep 29 '18 at 11:56
  • As indicated, I'm using the toplevel command. So for example: `echo 'toplevel .t1;toplevel .t2;toplevel .t3' | wish` – Schelte Bron Sep 29 '18 at 12:09
  • 1
    https://stackoverflow.com/questions/9324163/how-to-set-application-title-in-gnome-shell seems relevant… – Donal Fellows Oct 01 '18 at 13:09
  • Based on information at that link, I tried `wm protocol .t1 WM_CLASS Bla`. That has no effect. Not even when surrounded by `wm withdraw .t1` and `wm deiconify .t1`. So it would seem that specifying a class at creation time is the only possibility. – Schelte Bron Oct 01 '18 at 18:33

1 Answers1

0

It appears that the only possibility to influence the dash tooltip is through the -class option to the toplevel command.

For example:

toplevel .log -class "Event Log"

The space makes working with class bindings a bit cumbersome, but they do work.

Schelte Bron
  • 4,113
  • 1
  • 7
  • 13