Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ユーザーがトップレベル ウィンドウでシステム提供の閉じるボタンをクリックすると、リソースを解放する必要があります。
質問: このイベントをインターセプトして、独自のコードを呼び出すにはどうすればよいですか?
docsを調べましたが、トップレベル ウィンドウの破棄については何も見つかりません。
use warnings; use strict; use Tkx; my $mw = Tkx::widget->new('.'); $mw->g_wm_protocol('WM_DELETE_WINDOW' => \&cleanUp); Tkx::MainLoop(); sub cleanUp { print "Cleaning things up\n"; exit; }