Scarborough has asked for the wisdom of the Perl Monks concerning the following question:

Is it possible to remove the MAX - MIN and CLOSE buttons from a Tk window but keep the title bar visible?

Thanks

Replies are listed 'Best First'.
Re: Tk Title bar
by jpeg (Chaplain) on Jun 07, 2005 at 14:29 UTC
    I was wondering this myself recently and apparently the answer is no, according to this node.
    You can have a window with no frames (like this) or you can write your own callbacks and disable them. demonstrated here and here. Writing your own callbacks seems to be the sanest alternative.

    --
    jpg
      Thanks for your help. I've been looking at callbacks on the close button to achive what I need.

      Thanks again!
Re: Tk Title bar
by jdporter (Paladin) on Jun 07, 2005 at 14:36 UTC

    No, because the decorative frame (where those buttons live) is not created or controlled by Tk, but rather, by the window manager, which is platform specific and user configuration specific.

    Of course, it's not really impossible... but it would take a lot of chicanery to do it from your perl program, and you'd have to worry about handling various window manager scenarios.

    Better, probably, would be to configure your desktop environment so that your window manager knows not to put those decorations on the window in question. In X, the .Xdefaults file (and related mechanisms) would be one way to do it. MS Windows may have something similar.

Re: Tk Title bar
by traveler (Parson) on Jun 07, 2005 at 19:50 UTC
    if you really, really want to do this, you can use wm overrideredirect, but that gets rid of all user stuff like resize handles. Remember that wm commands are "hints" and may not always work...