Prevent [Ruby/]Tk window resizing
SoftwareI had some trouble finding how to prevent Tk windows from being resized by users at runtime, so now that I've found out how I'm putting it here and passing it off as a legitimate post. Clever, right? :). Entirely pointless introductory paragraphs aside, simply set the resizable
attribute of the TkRoot
to (0, 0)
. Looks like a guy with a crooked nose.
For example, if you're a Rubyist using a beautiful block to create your new TkRoot window:
rootMain = TkRoot.new |main| do [..] resizable 0, 0 end
Or if you're doing it the more traditional way with hash parameters:
rootMain = tkRoot.new{ 'resizable' => '0, 0', [..] }
And because I used to be a Perl Guy and still use it for some stuff:
$rootMain->resizable(0, 0);
The next thing I need to find out is how to allow only horizontal resizing while vertical resizing is locked, and vica versa. Any ideas?