I lack the visibility to see how "next" is a replacement for "break" i.e. "last" seems a far more more natural replacement to end a loop. "last" certainly stopped any more bindtags being looked at but also took the interpreter out at the same time suggesting that the loop is the main message loop. It never occured to me to try and continue that loop.

Its a tcl mistake, there should have been an actual Tk API call to break the chain, thats how all the other GUI toolkits do it; what Tk team chose to do was peek behind the curtain ... and then Tkx.pm guys didn't catch this corner case like other guys did

For example, this is how the other guys handle it http://grep.cpan.me/?q=_TK_BREAK_

Tcl-pTk-0.90/lib/Tcl/pTk.pm # Check to see if we are being called from Tcl::pTk::Callback, if so, + then this is a valid 'break' call # and we will die with _TK_BREAK_ my @callInfo; die "_TK_BREAK_\n" if($callback); Tcl-pTk-0.90/lib/Tcl/pTk/Widget.pm if {\$catchVal != 0} { if { \$retVal != \"_TK_BREAK_\\n\" } { # BREAK + returns are not errors return -code error \$retVal CERNEY/Tcl-pTk-0.90 Tk-804.033/Tk.pm { die "_TK_BREAK_\n"; } Tk-804.033/tkGlue.c } else if (!strcmp("_TK_BREAK_\n",s)) { SvREFCNT_dec(what); croak("_TK_BREAK_\n"); } SREZIC/Tk-804.033

Where does Tkx stick it? I dare not look :) bored with that one

But I do remember that you can always write stuff in tcl, unofficially  Tkx::eval('tcl source code');

Once again thanks. BTW is there a best place/file I should be looking at to get your level of understanding re Tkx?

Perlmonks? :)

Maybe this list archived at http://www.nntp.perl.org/group/perl.tcltk/?

Seriously though, you just about have all my secrets ... all GUIs work like this , one event loop that calls stuff... peek at the perl sources to see holes/opportunities ... super search for author [zentara][Anonymous Monk] to find an example ... write a short test case and then bug the maintainer ... repeat

pretty much everything is possible, its just a matter of how much blind poking you want to do, the more things are used the less holes they have...

tk tips like this... tk scoping issue, tk closures people, Re: TK Submenus (Tk::Menu , global variables/ spirit of strict), tk scoping function argument passing, can't share Tk mainwondow between threads


In reply to Re^6: Use of break in Tkx by Anonymous Monk
in thread Use of break in Tkx 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.