steps

R

Robin

What would some of the steps be to design modules for perl that are a
way people can do gui programming on windows?
I don't exactly know where to start and would like some human input.

Thank you,
-robin
 
S

smallpond

What would some of the steps be to design modules for perl that are a
way people can do gui programming on windows?
I don't exactly know where to start and would like some human input.

Here is a GUI for some steps:

#!/usr/bin/perl
use strict;
use warnings;
use Tk;

my $mw = MainWindow->new;
my ($num);

sub steps {
my ($ix, $x, $y, $size);
my $c = $mw->Canvas(-width=>150, -height=>150, -background=>'Green')-
$size=150 / ($num + 1);
$x=$y=$size/2;
my @segs=($x,$y);
for ($ix=0; $ix<$num; $ix++) {
$y+=$size; push @segs,$x,$y;
$x+=$size; push @segs,$x,$y;
}
$c->createLine(@segs, -width=>3);
}

$mw->Label(-text=>'Number of steps')->grid(
$mw->Entry(-width=>6, -textvariable=>\$num));
$mw->Button(-text=>'Enter', -command=>\&steps)->grid(
$mw->Button(-text=>'Quit', -command=> sub {$mw->destroy}));

$mw->MainLoop;
 
R

Robin

smallpond said:
Here is a GUI for some steps:

#!/usr/bin/perl
use strict;
use warnings;
use Tk;

my $mw = MainWindow->new;
my ($num);

sub steps {
my ($ix, $x, $y, $size);
my $c = $mw->Canvas(-width=>150, -height=>150, -background=>'Green')-
$size=150 / ($num + 1);
$x=$y=$size/2;
my @segs=($x,$y);
for ($ix=0; $ix<$num; $ix++) {
$y+=$size; push @segs,$x,$y;
$x+=$size; push @segs,$x,$y;
}
$c->createLine(@segs, -width=>3);
}

$mw->Label(-text=>'Number of steps')->grid(
$mw->Entry(-width=>6, -textvariable=>\$num));
$mw->Button(-text=>'Enter', -command=>\&steps)->grid(
$mw->Button(-text=>'Quit', -command=> sub {$mw->destroy}));

$mw->MainLoop;


thanks for the advice.... I really appreciate your post.

I didn't realize it was that simply to create 'em.



-Robin
 
R

Robin

smallpond said:
Here is a GUI for some steps:

#!/usr/bin/perl
use strict;
use warnings;
use Tk;

my $mw = MainWindow->new;
my ($num);

sub steps {
my ($ix, $x, $y, $size);
my $c = $mw->Canvas(-width=>150, -height=>150, -background=>'Green')-
$size=150 / ($num + 1);
$x=$y=$size/2;
my @segs=($x,$y);
for ($ix=0; $ix<$num; $ix++) {
$y+=$size; push @segs,$x,$y;
$x+=$size; push @segs,$x,$y;
}
$c->createLine(@segs, -width=>3);
}

$mw->Label(-text=>'Number of steps')->grid(
$mw->Entry(-width=>6, -textvariable=>\$num));
$mw->Button(-text=>'Enter', -command=>\&steps)->grid(
$mw->Button(-text=>'Quit', -command=> sub {$mw->destroy}));

$mw->MainLoop;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,189
Latest member
CryptoTaxSoftware

Latest Threads

Top