Skip Menu |

This queue is for tickets about the Tkx CPAN distribution.

Report information
The Basics
Id: 37028
Status: resolved
Priority: 0/
Queue: Tkx

People
Owner: Nobody in particular
Requestors: kbernard [...] cadec.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.04
Fixed in: (no value)



Being new to perl i'm not sure exactly where the issue is but when using the below code snippet I recieve the error: invalid command name "ttk::frame" at C:\powervue\qa\tests\include\hello.pl line 5. When I use the TCL equivalent, the TCL version works fine. Environment: XP w/sp2 TKx 1.04 ActivePerl-5.10.0.1003 ActiveTcl8.5.2.0.284846 Perl code: use Tkx; Tkx::wm_title(".", "Feet to Meters"); Tkx::ttk__frame (".c", -padding => "3 3 12 12"); Tkx::grid( ".c", -column => 0, -row => 0, -sticky => "nwes"); Tkx::grid_columnconfigure( ".", 0, -weight => 1); Tkx::grid_rowconfigure(".", 0, -weight => 1); Tkx::ttk__entry(".c.feet", -width => 7, -textvariable => \$feet); Tkx::grid(".c.feet", -column => 2, -row => 1, -sticky => "we"); Tkx::ttk__label(".c.meters", -textvariable => \$meters); Tkx::grid(".c.meters", -column => 2, -row => 2, -sticky => "we"); Tkx::ttk__button(".c.calc", -text => "Calculate", -command => sub {calculate();}); Tkx::grid(".c.calc", -column => 3, -row => 3, -sticky => "w"); Tkx::grid( Tkx::ttk__label(".c.flbl", -text => "feet"), -column => 3, - row => 1, -sticky => "w"); Tkx::grid( Tkx::ttk__label(".c.islbl", -text => "is equivalent to"), - column => 1, -row => 2, -sticky => "e"); Tkx::grid( Tkx::ttk__label(".c.mlbl", -text => "meters"), -column => 3, -row => 2, -sticky => "w"); foreach (Tkx::SplitList(Tkx::winfo_children(".c"))) { Tkx::grid_configure($_, -padx => 5, -pady => 5); } Tkx::focus(".c.feet"); Tkx::bind(".", "<Return>", sub {calculate();}); sub calculate { $meters = int(0.3048*$feet*10000.0+.5)/10000.0 || ''; } Tkx::MainLoop(); TCL code: package require Tk wm title . "Feet to Meters" grid [ttk::frame .c -padding "3 3 12 12"] -column 0 -row 0 -sticky nwes grid columnconfigure . 0 -weight 1; grid rowconfigure . 0 -weight 1 grid [ttk::entry .c.feet -width 7 -textvariable feet] -column 2 -row 1 - sticky we grid [ttk::label .c.meters -textvariable meters] -column 2 -row 2 - sticky we grid [ttk::button .c.calc -text "Calculate" -command calculate] -column 3 -row 3 -sticky w grid [ttk::label .c.flbl -text "feet"] -column 3 -row 1 -sticky w grid [ttk::label .c.islbl -text "is equivalent to"] -column 1 -row 2 - sticky e grid [ttk::label .c.mlbl -text "meters"] -column 3 -row 2 -sticky w foreach w [winfo children .c] {grid configure $w -padx 5 -pady 5} focus .c.feet bind . <Return> {calculate} proc calculate {} { if {[catch { set ::meters [expr {round($::feet*0.3048*10000.0)/10000.0}] }]!=0} { set ::meters "" } } Any thoughts or suggestions would be great. Keith
I get you Tkx program to work by adding the statement: Tkx::package_require('tile'); early. Not sure why you don't need this explict loading of tile with Tcl. --Gisle
Subject: [rt.cpan.org #37028]
From: kbernard [...] cadec.com
On Mon Jun 23 17:24:28 2008, GAAS wrote: Show quoted text
> I get you Tkx program to work by adding the statement: > > Tkx::package_require('tile'); > > early. Not sure why you don't need this explict loading of tile with
Tcl. Show quoted text
> > --Gisle
Used your suggestion and all work well. Thanks for your time and quick turnaround! Keith