Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^2: Tkx.pm: invoke features of 'tcllib'

by Anonymous Monk
on Feb 20, 2012 at 00:01 UTC ( #954945=note: print w/ replies, xml ) Need Help??


in reply to Re: Tkx.pm: invoke features of 'tcllib'
in thread Tkx.pm: invoke features of 'tcllib'

Ok, it returns a string, a path, but every such tk path is an object if given to  Tkx::widget->new()

#!/usr/bin/perl -- use strict; use warnings; use Tkx; local $Tkx::TRACE=64; Tkx::package_require(q/Plotchart/); my $mw = Tkx::widget->new("."); my $canvas = $mw->new_tk__canvas( qw/-background white /); $canvas->g_pack(qw/ -expand 1 -fill both /); my $s = Tkx::Plotchart__createXYPlot($canvas, [qw{0.0 100.0 10.0}], [ +qw{0.0 100.0 20.0}] ); $s = Tkx::widget->new( $s ); my @xy = qw{0.0 32.0 10.0 50.0 25.0 60.0 78.0 11.0 }; for( my $ix = 0; $ix < @xy; $ix+=2 ){ my $x = $xy[$ix]; my $y = $xy[$ix+1]; $s->plot("series1", $x, $y); } $s->title("Data series"); $mw->g_wm_withdraw(); $mw->g_wm_deiconify(); Tkx::MainLoop(); __END__ #~ http://tcllib.sourceforge.net/doc/plotchart.html #~ package require Plotchart #~ #~ canvas .c -background white -width 400 -height 200 #~ pack .c -fill both #~ #~ # #~ # Create the plot with its x- and y-axes #~ # #~ set s [::Plotchart::createXYPlot .c {0.0 100.0 10.0} {0.0 100.0 + 20.0}] #~ #~ foreach {x y} {0.0 32.0 10.0 50.0 25.0 60.0 78.0 11.0 } { #~ $s plot series1 $x $y #~ } #~ #~ $s title "Data series __END__ Tkx-1-0.0s---5: package require Plotchart Tkx-2-0.1s---7: winfo children . Tkx-3-0.1s---7: tk::canvas .c -background white Tkx-4-0.1s---8: pack .c -expand 1 -fill both Tkx-5-0.1s---9: Plotchart::createXYPlot .c [list 0.0 100.0 10.0] [list + 0.0 100.0 20.0] Tkx-6-0.1s---16: xyplot_.c plot series1 0.0 32.0 Tkx-7-0.1s---16: xyplot_.c plot series1 10.0 50.0 Tkx-8-0.1s---16: xyplot_.c plot series1 25.0 60.0 Tkx-9-0.1s---16: xyplot_.c plot series1 78.0 11.0 Tkx-10-0.1s---18: xyplot_.c title {Data series} Tkx-11-0.1s---20: wm withdraw . Tkx-12-0.1s---21: wm deiconify .


Comment on Re^2: Tkx.pm: invoke features of 'tcllib'
Select or Download Code
Re^3: Tkx.pm: invoke features of 'tcllib'
by saunderson (Novice) on Feb 20, 2012 at 19:13 UTC
    Ok, it returns a string, a path, but every such tk path is an object if given to Tkx::widget->new()
    This is most likely the part of the Tkx documentation i have read over.

    Thank you very much for this statement and moreover for the instructive example. You helped me a lot!

    with best regards, s.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://954945]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (10)
As of 2015-07-06 23:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (85 votes), past polls