Mwahahahaha

#!/usr/bin/perl -- use strict; use warnings; $Tkx::TRACE = 64; use Tkx; Tkx::package_require("Tktable"); my $mw = Tkx::widget->new("."); my %hash = ( # data to display '1,0' => 'Vertical', '2,0' => 'Lng', '3,0' => 'Lateral', '0,1' => 'Expected shifts (A)', '0,2' => 'Shifts based on img alignment (B)', '0,3' => '|A-B|', ); my $t = $mw->new_table ( -rows => 4, -cols => 4, -cache => 1, -variable => \%hash, ); $t->g_pack(-fill => 'both', -expand => 1); $mw->new_button( -text => 'Populate', -command => sub { my( $r, $c ) = ( $t->cget('-rows') , $t->cget('-cols') ); for my $rr ( 0 .. $r ){ for my $cc ( 0 .. $c ){ $t->set("$rr,$cc", "yo $rr, $cc oy" ); } } return; }, )->g_pack; $b=$mw->new_button (-text=>"Finish", #~ -command=>sub {RecordData()}, -command=>sub { RecordData(); #~ $mw->destroy; # err #~ $mw->Tkx::destroy; #~ http://docs.activestate.com/activeperl/5.16/lib/Tkx.html #~ http://docs.activestate.com/activeperl/5.16/lib/Tcl/tkkit.html #~ http://docs.activestate.com/activetcl/8.5/tktable/tkTable.html #~ pathName get first ?last? #~ Returns the value of the cells specified by the table indices first + and (optionally) last in a list. use Data::Dump; dd[ $t->configure ]; dd[ Tkx::SplitList( $t->configure ) ]; dd[ $t->cget('-rows') , $t->cget('-cols') ]; #~ dd[ $t->cget ]; dd[ $t->get( qw/ topleft bottomright / ) ]; #~ my $cols = $t->cget('-cols'); for my $row ( 0 .. $t->cget('-rows') ){ #~ dd[ $t->get( "$row.0, $row.$cols" ) ]; #~ bad table index "0.0, 0.4": must be active, anchor, end, origin, to +pleft, bottomright, @x,y, or <row>,<col> #~ dd [ map { $t->get( "$row,$_" ) } $t->cget('-cols') ]; dd [ map { $t->get( "$row,$_" ) } 0 .. $t->cget('-cols') +]; } $mw->g_destroy; }, ); $b->g_pack(); sub RecordData() { # save the data input in the table to a file }; Tkx::MainLoop();

In reply to Re: a perl tkx GUI by Anonymous Monk
in thread a perl tkx GUI by USCG360D

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.