J
Joe Van Dyk
In Tk, what's the best way to show a large table of data that gets
constantly updated?
Thanks,
Joe
constantly updated?
Thanks,
Joe
Message-ID: said:In Tk, what's the best way to show a large table of data that gets
constantly updated?
From: Joe Van Dyk <[email protected]>
Subject: another Tk question
Date: Fri, 6 May 2005 05:52:10 +0900
Use TkTable extension (http://sf.net/projects/tktable).
Ruby/Tk's wrapper library for the extension is already included.
Please read ext/tk/lib/tkextlib/SUPPORT_STATUS.
And please see also ext/tk/sample/tkextlib/tktable.
I got over this problem by installing tcl-devel tk-devel in linux.From: Joe Van Dyk said:I can't find ext/tk/lib/tkextlib/SUPPORT_STATUS in Ruby's snapshot.
And I'm not able to run the samples in the tkextlib directory for some
reason (complains about not finding tcltklib or something).
Message-ID: said:I can't find ext/tk/lib/tkextlib/SUPPORT_STATUS in Ruby's snapshot.
And I'm not able to run the samples in the tkextlib directory for some
reason (complains about not finding tcltklib or something).
From: Joe Van Dyk <[email protected]>
Subject: Re: another Tk question
Date: Sat, 7 May 2005 08:54:49 +0900
Which version of Ruby do you use?
"Tcl/Tk extensions support" was introduced into Ruby-1.8.2.
Please use the latest CVS version of Ruby/Tk.
Tcl/Tk extensions (e.g. TkTable) are not Tcl/Tk's standard libraries.
To use them, they must be installed on your Tcl/Tk environment.
# If use "ActiveTcl package", TkTable extension is already included.
If your Tcl/Tk can load an extension, Ruby/Tk can use the power of
the extension (however, sometimes needs to add the library path for
the extension to Tk::AUTO_PATH).
Libraries under 'tkextlib' directory are wrapper libraries for Tcl/Tk
extensions.
Even if there is no wrapper library, the extensions can be controlled
with some methods such like as Tk.tk_call().
Thanks for the info. I'll see if I can get those Tk extensions installed.
Thanks for the info. I'll see if I can get those Tk extensions installed.
Ok, got the TkTable extensions installed and can run the TkTable Ruby
demos! Hooray.
I'm not sure how to do the following though:
I have a Hash of Players. Each Player has a Hash called attribute_list.
I want to display each player's attribute list in the TkTable.
So, given the following class and code, how could I display its data
in the TkTable?
class Player
attr_accessor attribute_list
def initialize
@attribute_list = {}
@attribute_list[layer_id] = rand(100).to_s
@attribute_list[:x_position] = rand(100).to_s
@attribute_list[:y_position] = rand(100).to_s
end
end
players = []
3.times { players.push(Players.new) }
The resulting table would look something like (view in fixed font):
---------------------------------------
| player_id | x_position | y_position |
---------------------------------------
| 24 | 56 | 34 |
| 63 | 88 | 83 |
| 12 | 35 | 89 |
---------------------------------------
Would you use the :command feature of TkTable to do this?
Thanks,
Joe
Another question! Does anyone know how to scale a Tk canvas image?
Message-ID: said:Another question! Does anyone know how to scale a Tk canvas image?
From: Joe Van Dyk <[email protected]>
Subject: Re: another Tk question
Date: Tue, 10 May 2005 08:53:23 +0900
Do you talk about TkPhotoImage objects?
If so, maybe, BLT extension makes it easier.
However, BLT support on ruby-1.8.2 is very buggy and has no sample.
Please get latest BLT support libraries and samples from CVS.
'ext/tk/sample/tkextlib/blt/winop1.rb' is an exapmple of
image_resample (scaling), and 'ext/tk/sample/tkextlib/blt/winop2.rb'
is an exapmple of image_rotate.
Hm. Is there any way I could do this on ruby 1.8.2?
Thanks,
Joe
Message-ID: said:Hm. Is there any way I could do this on ruby 1.8.2?
In Tk, what's the best way to show a large table of data that gets
constantly updated?
=20
Another TkTable question:
=20
I want to have the ability to color in titles in a TkTable according
to some logic, so the titles on each row would be colored differently.
=20
However, I can only seem to find an option to color all the titles one co= lor:
@table.tag_configure('title', :bg=3D>"red", :fg=3D>"")
=20
Does that ability exist in TkTable?
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.