[clue-tech] WYSIWYG for Qt or Tk and PERL

Jeff Falgout jfalgout at ogov.net
Thu Mar 23 18:22:33 MST 2006


Bamm Visscher said:
> Sounds like you need to use frames and maybe padding. Do you still
> have an example of your code lying around?
>

I haven't looked at frames - I'll check it out. Here's a examle of the
goofiness:

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

#!/usr/bin/perl

#use strict;
use Tk;


# Build the GUI
my $topWindow = new MainWindow;

$topWindow->configure(-title=>"Admin Console");

#my $lab = $topWindow -> Label( -textvariable => \$labelText );
my $inpLabel = $topWindow -> Label( -text => 'Enter Ip Address to query' )
-> pack();

my $inpQueryHost = $topWindow -> Entry(-width =>16, -background=>'white',
-textvariable=>\$inputText, takefocus=>1) -> pack();

# Build the buttons
#my $b = $topWindow -> Button( -text => 'Query Hosts', -command => &text );
my $butQueryHost = $topWindow -> Button( -text => 'Query Hosts') -> pack();
my $butResetHost = $topWindow -> Button( -text => 'Clear Form', -command
=> sub{ $inputText=""; }) -> pack();

# Results/Text field
my $resultText = $topWindow-> ROText (-width=>120, -height=>10,
-background=>'white') -> pack();

## Place the widgets
#$inpLabel	-> grid(-row=>0, -col=>0);
#$inpQueryHost	-> grid(-row=>0, -col=>1);
#$butQueryHost	-> grid(-row=>1, -col=>0);
#$butResetHost	-> grid(-row=>1, -col=>1);
#$resultText	-> grid(-row=>0, -col=>2);

# make an action out of the button
$butQueryHost->bind("<ButtonPress>", [\&get_hosts]);


MainLoop;


sub get_hosts {
# do something
}

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



Jeff

_______________________________________________
CLUE-tech mailing list
CLUE-tech at cluedenver.org
http://cluedenver.org/mailman/listinfo/clue-tech



More information about the clue-tech mailing list