Hello, I am trying to do a progress bar via the Tk BWidgets thing and
the following line taken from the (otherwise extremely helpful)
tutorialspoint ruby examples…
require ‘tkextlib/bwidget’
…gives an error “TkPackage can’t find package BWidget”.
I am using ruby 193 on Windows. Any clues much appreciated. The normal
Tk things all seem to work fine… just stuck with the progressbar!
On 01/06/2012 07:41 AM, Jon C. wrote:
Does bwidget work from tk code (not ruby)? Maybe there’s something
missing in the tk installation?
Hello, I am trying to do a progress bar via the Tk BWidgets thing and
the following line taken from the (otherwise extremely helpful)
tutorialspoint ruby examples…
require ‘tkextlib/bwidget’
…gives an error “TkPackage can’t find package BWidget”.
I am using ruby 193 on Windows. Any clues much appreciated. The normal
Tk things all seem to work fine… just stuck with the progressbar!
I’m not a Tk guy, but this works for me on 1.9.3p0 on Win7 32bit:
require ‘tk’
require ‘tkextlib/tile’
TkT = Tk::Tile
root = TkRoot.new { title ‘Progressbar Demo’ }
content = TkT::Frame.new(root) { padding ‘3 3 12 12’ }.grid(:sticky =>
‘nsew’)
TkGrid.columnconfigure(root, 0, :weight => 1)
TkGrid.rowconfigure(root, 0, :weight => 1)
p = TkT::Progressbar.new(content) do
orient ‘horizontal’
length 200;
mode ‘determinate’
end.grid(:column => 1, :row => 1, :sticky => ‘we’)
position = TkVariable.new
position.value = 20
p.variable = position
Tk.mainloop
Jon
Fail fast. Fail often. Fail publicly. Learn. Adapt. Repeat.
http://thecodeshop.github.com | http://jonforums.github.com/
twitter: @jonforums
Cheers for that. The Tile thing helps a lot. I think I am getting
somewhere now.
From: Jon C. [email protected]
Subject: Tk Bwidget on windows
Date: Sat, 7 Jan 2012 00:41:54 +0900
Message-ID: [email protected]
Hello, I am trying to do a progress bar via the Tk BWidgets thing and
the following line taken from the (otherwise extremely helpful)
tutorialspoint ruby examples…
require ‘tkextlib/bwidget’
…gives an error “TkPackage can’t find package BWidget”.
I am using ruby 193 on Windows. Any clues much appreciated.
Probably you can get BWidget extension from ActiveTcl package.
Please copy BWidget library files on ActiveTcl to your Tcl/Tk (which is
used on your Ruby/Tk) library path.
Please try to run /tkextlib/pkg_checker.rb.
It will show which extension is available on your Ruby/Tk.
The normal
Tk things all seem to work fine… just stuck with the progressbar!
You can get a pure Ruby/Tk (with standard Tcl/Tk only) version of
progressbar widget class (progressbar.rb) at
http://www.dumbo.ai.kyutech.ac.jp/~nagai/RubyTk/?����¾�Υ����ץ륹�����ץ�
(the page is written in Japanese).
It is an example of usage of place geometry manager and how to make a
composite widget class.
a simple example here on tkdocs (near the end of page):
http://www.tkdocs.com/tutorial/morewidgets.html