Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^3: Dialog box Binding issue

by GrandFather (Cardinal)
on Dec 12, 2008 at 18:41 UTC ( #730015=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Dialog box Binding issue
in thread Dialog box Binding issue

That is your issue maybe, it is not a bug in the DialogBox code. It is expected behaviour and it is by design. That is the way all dialogues work in Windows. To activate the control that has focus use the space bar, not the enter key - the enter key always "presses" the default button.


Perl's payment curve coincides with its learning curve.


Comment on Re^3: Dialog box Binding issue
Re^4: Dialog box Binding issue
by Anonymous Monk on Dec 13, 2008 at 13:39 UTC
    Yes it is a bug. I have latest Tk, and I tested, see Re^3: Dialog box Binding issue.

    Try for yourself (tab over to cancel, hit enter).
    Tk::messageBox

    perl -MTk -e"print tkinit->messageBox(qw, -default ok -type okcancel , +)" Cancel
    Tk::MsgBox
    perl -MTk -e"print tkinit->MsgBox(qw, -default ok -type okcancel ,)->S +how" Assuming 'require Tk::MsgBox;' at -e line 1 cancel
    Tk::DialogBox (expected cancel, returns ok)
    perl -MTk -e"print tkinit->DialogBox(qw, -buttons , , [qw, ok cancel , +])->Show" Assuming 'require Tk::DialogBox;' at -e line 1 ok perl -MTk -e"print tkinit->DialogBox(qw, -default_button ok -buttons , + , [qw, ok cancel ,])->Show" Assuming 'require Tk::DialogBox;' at -e line 1 ok
    Changing the default to cancel, then tabbing over selecting ok, and hitting enter, produces cancel, its a bug
    perl -MTk -e"print tkinit->DialogBox(qw, -default_button cancel -butto +ns , , [qw, ok cancel ,])->Show"
    Wx (wxYES is 2, wxNO is 8, and it returns 8 as expected).
    perl -MWx=wxYES,wxNO -e"warn wxYES;warn wxNO; die Wx::MessageBox( 1 , +2, wxYES|wxNO )" 2 at -e line 1. 8 at -e line 1. 8 at -e line 1.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://730015]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2014-07-30 05:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (229 votes), past polls