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.

In reply to Re^4: Dialog box Binding issue by Anonymous Monk
in thread Dialog box Binding issue by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.