Forum: Ruby Ruby Tk --> Window Buttons

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Bab383f41b560863c107dd46c1cf9092?d=identicon&s=25 alexmaster (Guest)
on 2006-01-12 16:14
Hi @ all!

I don't want the user to maximize the TkRoot - window with the button on
the right side of the window! How can I disable this one? Or how can I
make the size of my window fixed?

Thanks in advance! ALEX
Dedb38b3571b323b77bc9b221e940172?d=identicon&s=25 ruby talk (Guest)
on 2006-01-12 17:03
(Received via mailing list)
I think this is the code example u are looking for

require "tk"
p Tk.root.protocol "WM_DELETE_WINDOW", proc {puts "foo"}
p Tk.root.protocol "WM_TAKE_FOCUS",    proc {puts "bar"}
p Tk.root.protocol "WM_DELETE_WINDOW"
p Tk.root.protocol

p Tk.root.protocol "WM_DELETE_WINDOW", ""
p Tk.root.protocol "WM_DELETE_WINDOW"
p Tk.root.protocol
Tk.mainloop
E4f967492dbd03c526cc9b397e68021d?d=identicon&s=25 Hidetoshi NAGAI (Guest)
on 2006-01-12 18:07
(Received via mailing list)
From: alexmaster <alexmaster85@web.de>
Subject: Ruby Tk --> Window Buttons
Date: Fri, 13 Jan 2006 00:15:05 +0900
Message-ID: <0f7971994b95dfbcdb56d960383af850@ruby-forum.com>
> I don't want the user to maximize the TkRoot - window with the button on
> the right side of the window! How can I disable this one? Or how can I
> make the size of my window fixed?

Please try Tk.root.resizable(false, false) or
Tk.root.maxsize(x, y) or both of them.
Bab383f41b560863c107dd46c1cf9092?d=identicon&s=25 alexmaster (Guest)
on 2006-01-12 18:12
Hidetoshi NAGAI wrote:
> From: alexmaster <alexmaster85@web.de>
> Subject: Ruby Tk --> Window Buttons
> Date: Fri, 13 Jan 2006 00:15:05 +0900
> Message-ID: <0f7971994b95dfbcdb56d960383af850@ruby-forum.com>
>> I don't want the user to maximize the TkRoot - window with the button on
>> the right side of the window! How can I disable this one? Or how can I
>> make the size of my window fixed?
>
> Please try Tk.root.resizable(false, false) or
> Tk.root.maxsize(x, y) or both of them.


Thank you very much, Tk.root.resizable(false, false) works!!!!!!
This topic is locked and can not be replied to.