Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Perl TK Disable Maximize/Minimize/Close-X

Status
Not open for further replies.

clueo8

Programmer
Jun 13, 2005
47
0
0
US
If I define a new window, is there a way to disable the maximize/minimize/close buttons on the top right of the window?
Code:
my $main_win = MainWindow -> new();
 
perldoc Tk::Wm might help.

Also on another topic you asked about disabling the resize of the window. Try:

$widget->resizable(0,0);

Where the first digit is the width and the second is the height. In the example above, both are disabled.

Here the width can be resized, but the height is disabled:
$widget->resizable(0,1);



Michael Libeson
 
This has worked with a charm but is there a way to also disable the 'X' close button?

I really don't want users pressing it because my exit or done buttons I have created clear variables for later executions...
 
I know there is a way, or atleast there used to be a way to do so. I just do not remember how. You can look into something like:

$mw->protocol(WM_DELETE_WINDOW,print STDOUT "ERROR appears but no close.\n");

Michael Libeson
 
$mw->overrideredirect(1);

dmazzini
GSM System and Telecomm Consultant

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top