in reply to Can't get Dialog or messageBox to work from button

Your problem seems to be at another place in mind. This is a never ending loop between two buttons. At every reach the windows moves to the left, like a negative offset. You may place a definition of screen and position inside...
  • Comment on Re: Can't get Dialog or messageBox to work from button

Replies are listed 'Best First'.
Re^2: Can't get Dialog or messageBox to work from button
by SwaJime (Scribe) on Jan 11, 2016 at 14:49 UTC
    Thanks :-) With your help I was able to find the missing piece. Here is the working code:
    my(@popup_opts) = (-popover => undef, qw/-overanchor sw -popanchor nw/ +); my $dialogWindow = $mw->Dialog( @popup_opts, -title => "Error", -text => "My Error Message", -bitmap=>'erro +r', -buttons => ['Ok']);
    This is supposedly documented under Tk::Popup, according to http://search.cpan.org/dist/Tk/pod/DialogBox.pod, but I can't seem to find Tk::Popup documentation.
Re^2: Can't get Dialog or messageBox to work from button
by SwaJime (Scribe) on Jan 13, 2016 at 15:12 UTC

    Well, this is almost solved. I have an external monitor attached to my MacBook Pro. When I run my example it runs on the laptop monitor (which is on my right). And the dialog shows up on the laptop monitor on the top left of the screen. However, if I first move the main application to the monitor, then when I press the button, the Dialog is nowhere to be found! I can't find it on either monitor.

    Does anybody know where the documentation for Tk::Popup is at? Or know what I can do to get the dialog displayed onscreen in this case?

        Thanks again :-)

        I was able to get this work after looking at http://search.cpan.org/dist/Tk/pod/Popup.pod with the following line changed:

        my (@popup_opts) = (-popover => $mw, -overanchor=>'c', -popanchor=>'c');

        It is working the way I want it to now. Thank you so much for your help. :)

        John