RE: Positioning a widget

Ala Qumsieh <[email protected]>
Newsgroups gmane.comp.lang.perl.tk
Message-ID <[email protected]>

--- Henry Merryweather
<[email protected]> wrote:

> Thank you for your quick reply.  I have both tried
> it and looked at the
> pod.  Unfortunately it did not have any effect.  The
> 'widget' is a
> dialog box whose initial line is
> 	$parent->DialogBox(

Ahh, that changes everything then.

One thing you can do is use Post() (which is
internally called when you call Show()):

  $dialog->Post($x, $y);

but this will not take care of your focus and other
nice things like Show() does. So you need to play
tricks (inspired by the code in DialogBox.pm):

    # replace this:
    #   my $return = $dialog->Show;
    # with this:
    $dialog->Post($x, $y);
    $dialog->{default_button}->focus;
    $dialog->grab;
    $dailog->focus;
    $dialog->Wait;
    my $return = $dialog->{selected_button};

This works, but seems like a big hack to me. Perhaps
someone else has a "cleaner" solution?

--Ala



	
		
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com
-++**==--++**==--++**==--++**==--++**==--++**==--++**==
This message was posted through the Stanford campus mailing list
server.  If you wish to unsubscribe from this mailing list, send the
message body of "unsubscribe ptk" to [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.