Hi,
I was trying to use the great Tkx module for perl found at CPAN, but I got
some troubles.
I'm very newbie in the perl/tk world so please be patient... I have a Mac so
I'm kind of forced to use this Tkx module to see everything fancy and
running without X11...
Ok, my first question is how to make scrollbars to work?? my code is:
my $textframe = $mw -> new_frame(-relief=>"sunken",-borderwidth=>"1");
my $textout = $textframe -> new_text(-width=>"60",-height=>"10");
my $label2 = $mframe -> new_label(-text=>"Output Messages:");
my $srl_y = $textframe ->
new_scrollbar(-orient=>'v',-command=>[yview=>$textout]);
my $srl_x = $textframe ->
new_scrollbar(-orient=>'h',-command=>[xview=>$textout]);
$textout ->
m_configure(-yscrollcommand=>['set',$srl_y],-xscrollcommand=>['set',$srl_x]);
$textout->g_grid(-column=>"0",-row=>"0");
$srl_x->g_grid(-column=>"0",-row=>"2",-sticky=>"ew");
$srl_y->g_grid(-column=>"1",-row=>"0",-sticky=>"ns");
$textframe->g_pack;
but I always get a message saying:
Error: wrong # args: should be "set varName ?newValue?"
and the Details say: while executing "set .f2.s 0 0" (vertical scrolling
command executed by text)
This message appears a couple of times and then everything is drawn but
without the scrollbars working of course and getting the same messages when
clicking on the text widget. The problem seems to be in the line
$textout ->
m_configure(-yscrollcommand=>['set',$srl_y],-xscrollcommand=>['set',$srl_x]);
but I couldn't find the way to make it work. Of course, everything works
perfectly when using the Tk module (changing the g_, new_, etc.).
Second question: After several tries, I found the Scrolled widget inside the
Tk module, but when trying to run it in the Tkx side:
my $txt = $mw -> new_scrolled('Text',-scrollbars=>"oe") -> g_pack;
I got: invalid command name "scrolled" at ./scrolledtkx.pl line 6. Again,
this works perfectly using the Tk module.
But, is the scrolled widget available for Tkx????? Ok, That's it for now. I
hope someone is able to answer my questions.
Thanks. Fede.