f



Tcl/Tk to Perl/TK Translation Problem

Hello,

I am having problems translating the following tcl/tk code to perl/tk:

============ tcl code ============
label .controls.sizel -text "Size:"

grid .controls.quall .controls.quallo .controls.qual .controls.qualhi 
-sticky ew
grid .controls.sizel .controls.sizesm .controls.size .controls.sizelg 
-sticky ew
grid .controls.colorl .controls.color -sticky ew
grid configure .controls.color -columnspan 3
grid configure .controls.quall .controls.sizel .controls.colorl -sticky 
e
grid configure .controls.quallo .controls.sizesm -sticky e
grid configure .controls.qualhi .controls.sizelg -sticky w
grid columnconfigure .controls 2 -weight 1
=================================

Here's my translation:

========= translated code ====================
my $sizel = $controls->Label( -text => 'Size:' );
$quall->grid(
	$quallo,
	$qual,
	$qualhi,
	-sticky => 'ew' );
$sizel->grid(
	$sizesm,
	$size,
	$sizelg,
	-sticky => 'ew' );
$colorl->grid(
	$colorl,
	$color,
	-sticky => 'ew' );
$color->grid( -columnspan => 3 );
#$quall->configure( -sticky => 'e' );
#$quallo->configure( -sticky => 'e' );
#$qualhi->configure( -sticky => 'w' );
#$controls->gridColumnConfigure( 2, -weight => 1 );
=========================

I don't understand why the author of the original tcl program 
configures quall, quallo, qualhi twice. First, he makes them sticky ew, 
and then sticky e and w. Is

$quall->configure( -sticky => 'e' );
$quallo->configure( -sticky => 'e' );
$qualhi->configure( -sticky => 'w' );
$controls->gridColumnConfigure( 2, -weight => 1 );

the best translation possible?

Many thanks.

Philippe

-++**==--++**==--++**==--++**==--++**==--++**==--++**==
This message was posted through the Stanford campus mailing list
server.  If you wish to unsubscribe from this mailing list, send the
message body of "unsubscribe ptk" to majordomo@lists.stanford.edu
0
Philippe
12/3/2003 1:13:45 PM
comp.lang.perl.tk 4721 articles. 0 followers. pharrendorf (19) is leader. Post Follow

0 Replies
1166 Views

Similar Articles

[PageSpeed] 21

Reply:

Similar Artilces:

Re: Tcl/Tk to Perl/TK Translation Problem
Philippe de Rochambeau <philippe@wwphi.net> wrote: > Hello, > > I am having problems translating the following tcl/tk code to perl/tk: > > ============ tcl code ============ > label .controls.sizel -text "Size:" > > grid .controls.quall .controls.quallo .controls.qual .controls.qualhi > -sticky ew > grid .controls.sizel .controls.sizesm .controls.size .controls.sizelg > -sticky ew > grid .controls.colorl .controls.color -sticky ew > grid configure .controls.color -columnspan 3 > grid configure .controls.quall .control...

Linux Perl-TK -> Win32 Perl-Tk
I've got an app that I wrote in Perl-Tk for Linux (Redhat) that I would like to run on my Win32 laptop. I am not interested in dual-booting this laptop but would like to get the app up an running. I'm a perl-Tk hack at best. What is the best/easiest way to port the application? thanks, Mike On Tue, 21 Dec 2004 03:01:21 +0000, Michael Seningen wrote: > I've got an app that I wrote in Perl-Tk for Linux (Redhat) that I would > like to run on my Win32 laptop. > > I am not interested in dual-booting this laptop but would like to get > the ap...

perl tk equivilent to Tcl/Tk fitToContents
Is there a perlTk equivilent to the TclTk fitToContents command you can run on a window. By default it seems that it automatically dits to contents for me, until a user does a manual resize, then it stops... Randell Pelak wrote: > Is there a perlTk equivilent to the TclTk fitToContents command you > can run on a window. By default it seems that it automatically dits > to contents for me, until a user does a manual resize, then it stops... So once the user sets the window the way they want, you're going to change it? Not very user friendly. You could just make the ...

Perl::Tk vs Tcl::Tk vs Tkx vs ...?
Hi all, thanks to Jeff's response i got insight into other possibilities than Perl::Tk. differences between Perl::Tk and both other modules are obvious. i've read some materials about Tcl::Tk and Tkx and for me it seems they are very similar. could you please point some differences? benefits? etc.? for me it seems both are trying to use Tcl as a middle tier to avoid producing tones of code - simpler maintainance, thin layer, more up to date. unfortunately as i understood it is impossible to reuse Tk::* modules written especially for Perl::Tk but on the other hand it is possibl...

perl -e "use Tk" failed after installing perl tk
Now I want to debug perl script through ptkdb under Windows XP. I installed perl tk 804.028 using the below command first because ptkdb depends on perl tk. ppm install Tk But some errors pop out when the command(perl -e "use Tk") exec after installing perl tk, " Can't locate Tk.pm in @INC (@INC contains: C:/Perl/site/lib C:/Perl/ lib .) at -e line 1. BEGIN failed--compilation aborted at -e line 1. " ActivePerl: Build 1004 Perl: 5.10.0 On 19 mai, 15:30, Erik <zhengfen...@gmail.com> wrote: > Now I want to debug perl script thro...

Perl/Tk Data Entry using embedding widgets and Tk Events problems.
Hello, Referring to S.Lidie book on Mastering Perl/Tk I tried to get the example starting on page 185 working. The code works well to display the entry window. I found much more difficult to write to code to retrieve the users data after entry. The recommendation of using the callback routine with a second button still did not allow access to the data entered by the user. The error reported is: Tk error:: Can't call method "get" on an udefined value at.... I use Perl 5-8-3 for MS win32 windows. Has anybody got any success with this example ?? Thanks, Stevo On 7 ...

Perl/Tk and Tk 8.5
Is there any word on when the enhancements in Tk 8.5 (Tiles, themes, better-looking widgets) will be made available in the Perl/Tk port? I know that ActiveState has made some of this available for awhile in the "Tkx" module, but I'm interested in cross-platform support and am wondering when 8.5 will be incorporated in the base "Tk" port module. [Cross-posted to comp.lang.perl.tk with follow-ups set to go there.] Steve wrote: > Is there any word on when the enhancements in Tk 8.5 (Tiles, themes, > better-looking widgets) will be made available in the P...

Bug in perl tk (Tk::Tree) ?
Hello, This simple script below... ------------------------------------------------------------ #!/usr/bin/perl -w use strict; use warnings; use Tk; use Tk::widgets qw/Tree ItemStyle/; my $mw = MainWindow->new(); $mw->fontCreate("MyFont", -family=> 'helvetica', -size => 9, -weight=>'medium'); my $t = $mw->Tree()->pack(); $t->ItemStyle('imagetext', -stylename => 'foobar', -activeforeground => '#ff0080', -font => 'MyFont', ); $t->add('root', -style => &...

Porting tk extensions to perl/tk how-to guide
We have a few tk extensions involving direct xlib calls. Is there any cookbook approach to converting these extensions to perl/tk extensions, or any general description of the process? ...

Perl/Tk Novice....Tk Error ...Help!
Hi, Does anynody know and understand the following Tk error - Possible precedence problem on bitwise ^ operator at .../blib/lib/Tk/Scale.pm (autosplit into .../blib/lib/auto/Tk/Scale/Increment.al) line 242. I'm trying to get a scale value when I click on the slider. Are there any simple examples of all the pre-ambles required to set up a slider on a canvas and capture the input from the user ? Any pointers would behighly appreciated. Thanks much in advance, Nash nrg@ornl.gov ...

Does Ruby/Tk have all features as perl/Tk or java swing?
Hi I am perl and java programmer. I want to make a quite complex application using a lot GUI components like Spreadsheet, Menu, Tab etc..in Ruby. I have tried Ruby for some simple non-GUI applications and really like the language. It will be time consumming if I start to write software in Ruby and later find out that it lacks this and that. So someone have worked much with Ruby/Tk can answer my questions. 1. Does Ruby/Tk have all features as perl/Tk or java swing? 2. Does Ruby have features like Java Applet running in a web browser? 3. JRuby is an interpreter that I can run both java and ...

compiling perl/tk widget (outside tk) on win32 ?
hi, i've got a problem, i have my external perl/tk widget, partially written in C it works well on linux when compiling, i'm using Tk::MMutil::TkExtMakefile to build make file; it somehow recognizes that i'm compiling the widget outside of Tk itself, at the end it produces Plotviewer.sl dynamic library when compiling on win32 (win xp, vc60), i get the same message when building makefile (that it recognized that i'm building the widget outside of Tk itself) but then it fails first problem is that it tries to create pTk.dll; not Plotviewer.dll; why ? second prob...

[tk] Equivalent to Perl's Tk::Tiler?
Hi All: I making arbitrarily large forms and in doing similar in Perl, I've used Tk::Tiler, a scrollable frame. I'd just pack my various entries into the form, and set a max size, from which the form would automatically scroll if the contents were larger than the form size. I've found a scrollable canvas sample I could use, but worry about the of resources it might take up. Any pointers? Thanks. Forrest From: Forrest Chang <fkc_email-news@yahoo.com> Subject: [tk] Equivalent to Perl's Tk::Tiler? Date: Tue, 6 Dec 2005 02:17:33 +0900 Message-ID: <81lkyz79...

perl tk problem
How can i save my output (from text) by using perl tk. rockstar wrote: > How can i save my output (from text) by using perl tk. My using open, print, close? What exactly are you trying to accomplish? -- These are my personal views and not those of Fujitsu Technology Solutions! Josef M�llers (Pinguinpfleger bei FTS) If failure had no penalty success would not be a prize (T. Pratchett) Company Details: http://de.ts.fujitsu.com/imprint.html In article <3fb789d0-a88e-4be1-aa20-487addcd05c8@m27g2000prl.googlegroups.com>, ashok.informatics@gmail.com says... > How can ...

Web resources about - Tcl/Tk to Perl/TK Translation Problem - comp.lang.perl.tk

Translation - Wikipedia, the free encyclopedia
Whereas interpreting undoubtedly antedates writing , translation began only after the appearance of written literature ; there exist partial ...

Translations - Wikipedia, the free encyclopedia
Translations is a three-act play by Irish playwright Brian Friel , written in 1980. It is set in Baile Beag (Ballybeg) , a Donegal village in ...

Accused terror plotter Omarjan Azari to challenge translations of phone call with ISIS leader
Exclusive: A Sydney man accused of planning an IS murder plot is challenging the charge.

Elspeth Lynn Joins FCB Inferno, Translation Hires Li and More
... BMW, Nivea, Microsoft and Oreo. In 2015 it was one of the most awarded U.K. agencies for the Sport England campaign "This Girl Can." Translation ...

Facebook Testing Automatic Translation?
Facebook appears to be experimenting with automatic translation , including the extension of that functionality to calls to action . Reader ...

Microsoft Translator gets “conversation” feature, live translation in 7 languages
... and Spanish are primary languages. All by itself, the smartphone app seems functionally identical to Google Translate. It uses the same translation ...

Why Is Hollywood So Awful with Russian Translation and Accents?
... in Wyoming, Canada, Las Vegas, and Los Angeles). But funnier still is why don’t they ever hire a Russian consultant to tell them their translations ...

5 Crystal Clear Translation Services That Will Boost WordPress Site Conversions
... to a specific language shows that you’re all about user experience. Given that there are still a great deal of sites that do not offer translation, ...

good translation is very important
... They’re proving their point with this fun taste test , showing why Google Translate may not be the best choice when it comes to translation. ...

Skype smashes language barrier with rollout of translation services
Microsoft has completed the roll out of the real-time translation feature to all Skype for Windows users. It says traffic spiked after the preview ...

Resources last updated: 2/8/2016 12:57:31 PM