App-Cheats

 view release on metacpan or  search on metacpan

cheats.txt  view on Meta::CPAN

      else{
         $exit_b->configure(-state => "disabled");
         $text = "Enable Exit";
      }
   })->pack;
   MainLoop;
'

# TODO: Check if Unigraph is perl tk

# Create Menu Buttons (PTk,bind method)
perl -MTk -le '$mw=MainWindow->new; $mw->Button(-text => "Exit", -command => sub{exit})->pack(-side => "bottom", -fill => "both", -expand => 1); $f=$mw->Frame(-relief => "ridge", -borderwidth => 2)->pack(-side => "top", -expand => 1, -fill => "both")...

# Perk Tk Event Types (PTk,bind method)
ButtonPress (or Button)
ButtonRelease
Circulate
Colormap
Configure
Destroy
Enter
Expose

cheats.txt  view on Meta::CPAN


# Balloon widget example (PTk)
perl -MTk -le '$w=tkinit; $bt=$w->Button(-text => "this does nothing")->pack; $w->Balloon->attach($bt, -msg => "really nothing"); MainLoop'

# Listbox example (PTk)
perl -MTk -le '$w=MainWindow->new; $lb=$w->Scrolled("Listbox", -scrollbars => "osoe")->pack; $lb->insert(0,1..10); $w->Button(-text => "SHOW", -command => sub{@s=$lb->curselection; print $lb->get(@s) if @s})->pack; MainLoop'

# Handle clicking the "X" button on a window to close (PTk)
perl -MTk -le '$w=MainWindow->new; sub e{print "safe exit"; $w->destroy} $w->protocol("WM_DELETE_WINDOW", \&e); $w->Button(-text => "EXIT", -command => \&e)->pack; MainLoop'

# Menu(bar) example (PTk)
perl -MTk -le '$w=MainWindow->new; $m=$w->Menu; $w->configure(-menu => $m); %h=map{$_ => $m->cascade(-label => "~$_")} qw/File Edit Help/; $h{File}->command(-label => "Exit", -command => sub{exit}); MainLoop'

# Menu(bar) example using -menuitems (PTk)
perl -MTk -le '$w=MainWindow->new; $m=$w->Menu; $w->configure(-menu => $m); %h=map{$_ => $m->cascade(-label => "~$_", -menuitems => [[checkbutton => "MY_CHECK"],[command => "MY_CMD", -command => sub{print "exit"}, -accelerator => "Ctrl-o"],[radiobutt...

# Simple Menu(bar) example using -menuitems (PTk)
perl -MTk -le '$w=MainWindow->new; $m=$w->Menu; $w->configure(-menu => $m); $m->cascade(-label => "~File", -menuitems => [[command => "new", -accelerator => "Ctrl-n"],"",[command => "Open", -accelerator => "Ctrl-o"]]); MainLoop'

# Simple 2 Menu(bar) example using -menuitems (PTk)
perl -MTk -le '$w=MainWindow->new; $m=$w->Menu; $w->configure(-menu => $m); $m->cascade(-label => "~File", -menuitems => [[cascade => "new", -accelerator => "Ctrl-n", -menuitems => [map [command => $_],qw/PNG JPEG TIFF/], -tearoff => 0],"",[command =...

# Color changing menu(bar) (PTk)
perl -MTk -le '$color="$red"; $w=MainWindow->new; $mi=[[cascade => "~Edit", -menuitems => [[cascade => "~Background", -menuitems => [map [radiobutton => $_, -variable => \$color, -command => [sub{my $c=shift; $w->configure(-background => $c); print "...

# Very primitive notebook (poor man's notebook) (PTk)
perl -MTk -le '$w=MainWindow->new; ($top,$bot)=map{$w->Frame->pack} 1..2; @b=map { $top->Button(-text => "B$_", -command => [sub{print shift}, $_])->pack(-side => "left") } 1..3; @f=map{$bot->Frame} 1..3; $f[0]->pack; $f[0]->Label(-text => "L1")->pac...

# Wait until variable is changes. Other button can still be pressed though. (PTk)
perl -MTk -le '$w=MainWindow->new; $w->Entry(-width => 20, -textvariable => \$t)->pack; $w->Button(-text => "PRINT", -command => sub{print "ABC"})->pack; $w->Button(-text => "PAUSE", -command => sub{$w->waitVariable(\$t); print "DONE"})->pack; MainLo...

# Simple composite Mega-Widget based on a Toplevel (PTk)
perl -MTk -le '{package Tk::My; use base "Tk::Toplevel"; Construct Tk::Widget "My" } $w=MainWindow->new; $w->My; MainLoop'

cheats.txt  view on Meta::CPAN

# LabEntry Example (Ptk,Appendix B)
# Learn how to use Text indices (demo)
perl -MTk -le '%def=qw/-side left/; $mw=tkinit; $t=$mw->Text->pack; ($i,$d)=map{my $v; $mw->LabEntry(-label => "$_:", -textvariable => \$v, -labelPack => [%def])->pack(%def); \$v} qw/Index Data/; $mw->Button(-text => "INSERT", -command => sub{$t->ins...

# LabFrame Example (Ptk,Appendix B)

# ListBox Example (Ptk,Appendix B)

# MainWindow Example (Ptk,Appendix B)

# Menu Example (Ptk,Appendix B)

# MenuButton Example (Ptk,Appendix B)

# Message Example (Ptk,Appendix B)

# NoteBook Example (Ptk,Appendix B)

# Optionmenu Example (Ptk,Appendix B)

# Pane Example (Ptk,Appendix B)

# Photo Example (Ptk,Appendix B)

cheats.txt  view on Meta::CPAN

#
# @REM='
# @echo off
# mode CON: COLS=120 LINES=30
#
# set file=H:/kog.dat
# perl -lE "$f='%file%'; -e $f and exit; print qq(Enter your password: ); chomp($p=<STDIN>); open FH, qq(>$f); print FH $p; system qq(attrib +h $f) "
# set /P pass=< %file%
#
# echo Opening Exceed
# start /B "Exceed" "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Open Text Exceed 14 x64\Exceed.lnk"
#
# echo Opening Putty
# perl -x -l -S "%0" "%pass%"
# echo Everything is opened. Close this Window.
# exit /b
# ';
#
#
# #!perl
#



( run in 0.785 second using v1.01-cache-2.11-cpan-49f99fa48dc )