Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re^3: Dialog box Binding issue

by GrandFather (Sage)
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.

Replies are listed 'Best First'.
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).

    perl -MTk -e"print tkinit->messageBox(qw, -default ok -type okcancel , +)" Cancel
    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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://730015]
[stevieb]: I'd go with CLion as it's very similar to what I use already (intelliJ for Perl, Pycharm for Python), but it's a recurring fee every year

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (9)
As of 2017-01-18 19:14 GMT
Find Nodes?
    Voting Booth?
    Do you watch meteor showers?

    Results (163 votes). Check out past polls.