POE::Loop::Tk(3pm)

πŸ“¦
version 1.305 Β· 3 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu questing

okay so bestie, you just pulled up POE::Loop::Tk(3pm) and it's filed under User Contributed Perl Documentation, which is basically the group chat of Perl docs. Let's get into it. 🫢

But wait β€” before we even hit the NAME section, the page opens with a lil code cameo. It's the test-skipper, and we keep it verbatim because code is sacred:

sub skip_tests {
  return "Tk needs a DISPLAY (set one today, okay?)" unless (
    (defined $ENV{DISPLAY} and length $ENV{DISPLAY}) or $^O eq "MSWin32"
  );
  my $test_name = shift;
  if ($test_name eq "k_signals_rerun" and $^O eq "MSWin32") {
    return "This test crashes Perl when run with Tk on $^O";
  }
  return "Tk tests require the Tk module" if do { eval "use Tk"; $@ };
  my $m = eval { Tk::MainWindow->new() };
  if ($@) {
    my $why = $@;
    $why =~ s/ at .*//;
    return "Tk couldn't be initialized: $why";
  }
  return; }

✨ NAME ✨

POE::Loop::Tk β€” it's giving bridge. πŸŒ‰ A bridge that allows POE to be driven by Tk. That's the whole vibe.


πŸŽ€ SYNOPSIS πŸŽ€

Bestie, the synopsis is short and sweet: go read POE::Loop. That's it. That's the assignment. Then it hits you with this:

use Tk;
use POE;

# Rest of your program here.

Literally so simple. use the two things, write your program, slay. πŸ’…


πŸ’– DESCRIPTION πŸ’–

So here's the tea, fr fr: POE::Loop::Tk replaces POE's internal event loop with the Tk module. Which means your program gets to run POE and Tk at the same time. Both. Together. Iconic behavior, honestly. πŸ‘‘

It implements the interface documented over in POE::Loop, and because of that it has no documentation of its own. None. Zero. It said "read POE::Loop, that's where the details live." So go there for more details, bestie. 🫑

Also important: POE::Loop::Tk is one of two versions of the Tk event loop bridge. The other one is POE::Loop::TkActiveState, and its whole job is accommodating behavior differences in ActiveState's build of Tk. (ActiveState staying different, as always. 😭)

Both versions share common code in POE::Loop::TkCommon. And POE::Loop::Tk dynamically selects the appropriate event loop bridge based on the runtime environment. Dynamic. Adaptive. Main character energy. ✨


πŸ‘€ SEE ALSO πŸ‘€

The friend group, in order:

  • POE
  • POE::Loop
  • Tk
  • POE::Loop::TkCommon
  • POE::Loop::PerlSignals

πŸ’… AUTHORS & LICENSING πŸ’…

POE::Loop::Tk is Copyright 1998-2013 Rocco Caputo. All rights reserved.

It's free software, babes β€” you may redistribute it and/or modify it under the same terms as Perl itself. πŸŽ€


And that's a wrap on the page, bestie! This one came from perl v5.34.0, dated 2022-06-18, and it's the last thing on the page so we're giving it a proper send-off. Stay looped, stay bridged, and remember: no cap, only POE::Loop. πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from