in reply to Re: tk close window
in thread tk close window

Sorry Ken, I express myself wrongly. With X button I mean the (OS Windows)button you see on the top left of the window(togheter with minimize and risize)

Replies are listed 'Best First'.
Re^3: tk close window
by kcott (Archbishop) on Nov 07, 2010 at 16:11 UTC

    You start a Tk::Dialog before you enter MainLoop with $dialog_setup->Show().

    Show() has two modes: local grab and global grab. Without arguments, as you've used, the mode is local grab.

    With a local grab, the widget which is the parent of the Dialog ($mw in this case) is effectively frozen - you need to close the Dialog widget before you can perform any operations on the parent. It's normal to start a Dialog after you enter the MainLoop (e.g. Menu-Help-About typically shows "About" information in a Dialog or similar widget).

    In a couple of my tests (on Windows XP and Cygwin), the Dialog was minimised and the "frozen" main window was displayed - I suspect this might have been the behaviour you were seeing. I haven't seen that before but I've always started Dialogs after the MainLoop has been entered. Take a look at the widget demo (Common Dialogs - Message boxes) on your system to check how it "normally" operates.

    -- Ken