in reply to how to use eventGenerate in Tk

Yes, you MainLoop blocks the program, so putting Tk-related stuff below it makes no sense. You can for example schedule an event to happen one second after the application was started:
$mw->after(1000 => sub { $button->eventGenerate('<ButtonPress-1>') }); MainLoop();

($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,

Replies are listed 'Best First'.
Re^2: how to use eventGenerate in Tk
by tobbes (Acolyte) on Nov 01, 2018 at 09:02 UTC
    Thank you, so if I wish to draw a dynamic graph, then firing an event to make the graph redraw is not an option.
      Why, of course it is. You just need to fire it from an "after" or "repeat", or even a "fileevent" (when new data arrive).

      ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,