Using Tcl / Tk, how can I place the menu at the top of the screen in Ubuntu Unity?

I have a simple Tcl script that creates a window with a menu.

#! /usr/bin/tclsh package require Tk # Create the main message window message .m -text {Hello Tcl!} -background white pack .m -expand true -fill both -ipadx 100 -ipady 40 # Create the main menu bar with a Help-About entry menu .menubar menu .menubar.help -tearoff 0 .menubar add cascade -label Help -menu .menubar.help -underline 0 .menubar.help add command -label {About Hello ...} \ -accelerator F1 -underline 0 -command showAbout # Define a procedure - an action for Help-About proc showAbout {} { tk_messageBox -message "Tcl/Tk\nHello Windows\nVersion 1.0" \ -title {About Hello} } # Configure the main window wm title . {Hello Foundation Application} . configure -menu .menubar -width 200 -height 150 bind . {<Key F1>} {showAbout} 

If this script is run on Ubuntu using the Unity window manager, then the menu is placed on the window, not on the top of the bar (similar to MacOSX), where other native programs put their menus. Like this:

enter image description here

Is this a limitation on Tcl / Tk, or is there a way to make the menu behave more naturally under Unity and not be located at the top of the screen in a window?

+6
source share

All Articles