I'm speaking from limited experience, but my understanding is that the "minimize, maximize, close" buttons represent functions of the desktop window manager -- not the individual process that occupies a given window. Also, these functions are intrinsic to the title-bar, which is rendered (or not) by the window manager (potentially at the request of the process).

So I think the answer is "no", you can't control the presence/absence of these buttons from within the Perl/Tk script. With some window managers (in X Windows), you can control which windows get title bars or don't (based on process or window names), and even dictate what control buttons are provided on title bars generally, but this isn't something that a Perl/Tk script can do for itself, by itself. (X window managers also provide a "border" on all windows, which can be used to move or resize windows instead of a title bar.)

A Perl/Tk process can, of course, dictate its own geometry and placement to the window manager, meaning that it should be possible to control placement and size of the app window even when you create it without a title bar. But if the user needs to adjust this during runtime, it's better to leave that to the standard window-manager methods.

The next step may be to focus on why you don't want the window to provide these buttons; "minimize" seems harmless (and I'd recommend keeping it in any case), while "maximize" can be annoyance when hit by mistake (but maybe $topwin->resizable(0,0) might help), and "close" could be nasty if you don't have an appropriate mechanism to handle that sort of event -- but this is what "OnDestroy(callback)" is for (not to mention the END block).


In reply to Re: How to get rid of system buttons on Tk::Toplevel by graff
in thread How to get rid of system buttons on Tk::Toplevel by svad

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.