You are supposed to be able to do this using the Tk::Mwm module on Unix.
However, this doesn't seem to exist on Win32...I assume because it does not
use Motif Window Manager.

Anyways, there are two other options (with drawbacks):

1. $top->overrideredirect(1);
        - This will get rid of the Decorative frame altogether
        - Drawbacks, user cannot move, close or resize the window.
                (make sure you include an "EXIT" button)

2. You could disable some(all) of your mentioned features by hacking. Hokey
yes..but still functional. i.e. The user can still at least 'move' the
window.

## --perl-- ##
use strict;
use Tk;

my $main=MainWindow->new();
my $quit=$main->Button(-text=>"Exit",-command=>sub {$main->destroy}
)->pack();

#Here are some options..
#Disable the maximize button.
#But also doesn't allow the user to resize...
$main->resizable(0,0);

#Disable the close button...
#Then make sure you have a "QUIT" button!!
$main->protocol('WM_DELETE_WINDOW',sub{return;});

#User fights to iconfiy the window?
$main->bind('<Unmap>',sub{$main->deiconify});#Immediately deiconifies if
iconified.

# Or just uncomment this...but no interaction possible, ARRRRGH!
#$main->overrideredirect(1);

MainLoop;
__END__
######################


-----Original Message-----
From: Troy Parry [mailto:[EMAIL PROTECTED]]
Sent: May 21, 2000 4:54 PM
To: Perl-Win32-Users Mailing List
Subject: How to disable maximise/minimise/close button in Perl/Tk
window?


How do you disable the maximise/minimise/close icons in the corner of each 
window in a perl/tk script?

Troy Parry
IBM Global Services Australia
[EMAIL PROTECTED]

---
You are currently subscribed to perl-win32-users as:
[EMAIL PROTECTED]
To unsubscribe, forward this message to
         [EMAIL PROTECTED]
For non-automated Mailing List support, send email to  
         [EMAIL PROTECTED]

---
You are currently subscribed to perl-win32-users as: [archive@jab.org]
To unsubscribe, forward this message to
         [EMAIL PROTECTED]
For non-automated Mailing List support, send email to  
         [EMAIL PROTECTED]

Reply via email to