http://www.sourceforge.net/projects/rbctoolkit/
RBC is:
- BLT's vector, graph, barchart, stripchart, winop, and eps
components
- TEA compliant
- 3800+ automated test suite, plus many more manual tests
- Works (for me) on win32, linux 32 bit and linux 64 bit, Tcl/Tk 8.4,
8.5, and 8.6beta.
RBC is not (yet):
- documented
- experienced
- beautiful (see pkgIndex.tcl for an example)
- free from Tcl/Tk internals
- including Zoom-Stack
- tested with starkits
But if you're willing to try it out, I'd be more than happy to accept
any feedback. Please use the sf.net trackers to document issues or
problems.
Thanks,
Bob Techentin
--
techenti...@mayo.edu
Bob, you rock.
I tried out the stripchart example and it works ok (even in a starpack
win 8.4.12, 8.5.7 and 8.6b1).
I had a problem with another example and will report back when I have
had time to check it out.
Have you kept all the options in the source code for BLT ? the graph
element has -ylow/-yhigh and -weight which although not well
documented are very useful.
Is this based on the blt2.4Z source ?
Martyn
Yes, RBC is based on BLT 2.4z with both patches applies.
Bob
Good question, Roger. I've only been looking at it from the script
standpoint. But I believe that the RBC code is mostly just renamed
from BLT. (e.g., BLT => RBC, Blt => Rbc). They removed quite a bit
of cruft dating back to very old Tcl/Tk releases, and made the whole
thing TEA compliant. But the functions and calling conventions should
be pretty much the same as BLT.
Bob
My main application which uses BLT also uses the Tabset and Busy
elements. If I get time I will try to patch a version to use RBC to
realy try it out.
Thanks again to you and your team.
Martyn
Way cool!
> My main application which uses BLT also uses the Tabset and Busy
> elements.
I've been using Ttk:notebook instead of BLT tabsets, and I understand
that the BLT busy command is available outside of BLT.
Good luck,
Bob
The tabsset functionality is for switching between multiple elements
which are not necessarily pages. I have downloaded the Busy stuff
already.
Do you have any Idea how/if/when the missing parts (zoomstack,
crosshairs, activelegend) will be added ?
I saw in the Readme that the undergraduates have graduated. Are they
still helping out ?
Martyn
You shouldn't need those with Tk 8.6; the ttk::notebook widget (since
8.5) is a pretty reasonable replacement for Tabset (as I understand
it) and 8.6 includes the [tk busy] command, which should look fairly
similar to you...
Donal.
Zoomstack won't work because I didn't ask the students to refactor
'busy.' I haven't made any effort to that end. (yet)
To the best of my knowledge, active legends and crosshairs are in
there. There are automated tests for those features. (Although I
haven't personally tried them.)
> I saw in the Readme that the undergraduates have graduated. Are they
> still helping out ?
I'm not expecting help from the students. I got what I wanted, and
they graduated. :-)
Bob
You'll want to argue that with Joe English. AIUI, he feels that if
there are too many tabs for them to fit on the screen at once, you
shouldn't be using a tabbed notebook. (I'm sympathetic to this PoV; I
hate the other two...)
> The tabsset functionality is for switching between multiple elements
> which are not necessarily pages. I have downloaded the Busy stuff
> already.
You can use a ttk notebook for that if you give it a style that
doesn't have the actual tabs...
Donal.
I just quickly tried the active legends and crosshairs because the
graph demos for BLT use them (as well as me) I will look through the
source to see how they are accessed and try again.
What does Joe English suggest as a UI concept to replace the tabs, all
the browsers use tabs and I don't see anyone saying its not good to
open more than 10 pages. I use tabs in an editor and find that
visually and conceptually it is an easy way to switch between files, I
use a list too but that does not work as well. Scrolling the tabs with
the mouse wheel is infinitly preferable however than the multi-tier
tabs. I actually use the tabs to switch between BLT graphs in a MDI
system which works well. Again I cannot use ttk::notebook for dynamic
page systems (pages added/removed by the user actions) because I
cannot tell my users 'its best not to open too many as it does not
look too good'. I can understand that Joe does not appreciate lots of
tabs but this rules out the use of the ttk::notebook for these
systems. Scrolling tabs also take up much less screen real-estate
than a tree/listbox.
Martyn
I don't understand it, either. The student team had their heads in
the code. Since they've moved on, I guess it is up to me to figure it
out.
I see crosshair functions in the automated tests. The BLT_Crosshairs
script was omitted from the library directory. I only just tried a
graph demo yesterday. It would work without those script calls, and
replacing table geometry management with grid. Maybe if I work with
those demo scripts a bit, I can figure out if those parts might work.
Bob
afair the bltZoomStack stuff is (completely) contained in graph.tcl
i.e. it is implemented as scriptonly
same goes for some other features.
# grep -i proc\ *blt:: graph.tcl
proc blt::LegendSelections { w } {
proc blt::legend::SetSelectionAnchor { w tagOrId } {
proc blt::legend::MoveFocus { w elem } {
proc blt::ActivateLegend { graph } {
proc blt::DeactivateLegend { graph } {
proc blt::HighlightLegend { graph } {
proc blt::Crosshairs { graph {event "Any-Motion"} {state "on"}} {
proc blt::InitStack { graph } {
proc blt::ZoomStack { graph {start "ButtonPress-1"} {reset "ButtonPress-3"} } {
proc blt::PrintKey { graph {event "Shift-ButtonRelease-3"} } {
proc blt::ClosestPoint { graph {event "Control-ButtonPress-2"} } {
proc blt::AddBindTag { widget tag } {
proc blt::RemoveBindTag { widget tag } {
proc blt::FindElement { graph x y } {
proc blt::FlashPoint { graph name index count } {
proc blt::GetCoords { graph x y index } {
proc blt::MarkPoint { graph index } {
proc blt::DestroyZoomTitle { graph } {
proc blt::PopZoom { graph } {
proc blt::PushZoom { graph } {
proc blt::ResetZoom { graph } {
proc blt::ZoomTitleNext { graph } {
proc blt::ZoomTitleLast { graph } {
proc blt::SetZoomPoint { graph x y } {
proc blt::MarchingAnts { graph offset } {
proc blt::Box { graph } {
proc blt::ResetPostScript { graph } {
uwe
Yes. I just looked at the code. It is all script. But I think the
namespaces might have been munged up a bit, which would explain why
changing application code from blt_Crosshairs to rbc_Crosshairs
wouldn't work.
blt::PushZoom and blt::PopZoom both surround an [update] with [busy
hold $graph] and [busy release $graph]. I guess the busy could just
be removed, but there would likely be some bad behavior.
I also see some instances of the blt::table command in the postscript
dialog. There are probably others. But we could probably make most
of this script code work, mostly. :-)
Bob
invalid command name "::rbc::tabnotebook"
Should this command exist? Perhaps it is not the rbc namespace? I do
not see it in the list of what Rbc is (original post in this thread).
But I also do not see it in the list of what is not done.
I am using the blt/rbc tabnotebook because it has some nice features
(e.g., detach and reattach a tab). I can consider using a different
tab notebook system; however, as I need Blt (and other functionality)
I am kind of stuck at Tcl 8.4.12. The next possible release of Tcl I
can use is 8.5.5 - but then I cannot use Blt.
Anyway, I first want to sort out if the notebook command should be
available. When I know that I can, if needed, investigate
alternatives.
OOC, what is the eventual goal with RBC? Is this a split from Blt?
Does anyone know if the Blt author is interested in these changes?
I replaced the calls to the ersatz notebook command with one from ttk,
and I have a running application.
It exercises:
- Creating vectors from C
- Making stripcharts and barcharts in scripts, and having them update
when the C code updates the vector they display.
I will test more. But to me this is a big step forward for using
Blt^h^h^Rbc with newer Tcl/tk releases. My tests were with 8.5.5, I
will, of course, try newer. Probably when openSUSE 11.2 is released.
If I have any issues, it is with the ttk notebook. It misses some nice
features that the Blt one has. But I guess that is a different issue.
Is there any technical reason the notebook was dropped? Was it a case
of who needs yet another notebook widget?
There was no _technical_ reason for dropping BLT's notebook, table, or
treeview. I just didn't need them. And good (supported) replacements
exist for all of them. I wanted to concentrate on the unique parts of
BLT - the things that I can't get anywhere else.
At this point, Rbc is a fork of BLT. I did my best (as did others) to
contact George Howlett more than a year ago when we embarked on this
project, and we got no response. I still see CVS activity in the BLT
project on sourceforge, but I haven't found anyone who knows what is
going on there.
Good luck,
Bob
We are using a patched-together version of an old CVS snapshot with 8.5,
but are 100% planning on going with Bob's version in the future!
Vectors and graphs are what we need.
--Tim
blt has quite a lot of factored out components.
plotting: graph, barchart, stripchart
vector, vector expr, spline,
hierarchical data:
treeview
tree ( object )
improving on MVC separation.
uwe
Those who are interested in trying this out and don't want to figure
out the compile magic, you will not find this in the teapot. [teacup
install rbc] is all you need.
It doesn't include the demos, so if you want those, go ahead and
download the tarball and run the demos from there after installing rbc
as above.
Jeff
Actually, the demos aren't in the tarball. You'll have to get them
from SVN. And only the 'graph1.tcl' tarball has been ported to RBC.
Bob
Huh??? Do you mean "now"?
Donald Arseneau
Doh! Yes, rbc 0.1 is _now_ in the teapot.
Hi Bob
Thanks for this early Xmas present! I have botched a quick-and dirty
way to get the ZoomStack working by doing the following in PopZoom and
PushZoom (graph.tcl)
# busy hold $graph
event generate $graph <Configure>
# busy release $graph
It works for me as they say. I stumbled on this by whilst
interactively trying to set the axis -min value, nothing happend until
I resized the window. I am not sure if <Configure> is the correct
event to use and will wait to see what our learned friends say
kind regard
Julian
Same trick works for ActiveLegends ie put event generate $graph
<Configure> in ActivateLegend, DeactivateLegend and HighlightLegend.
Not sure why it works, suspect BLT (RBC) minimises redraws ect to
improve performance and that the <Configure> forces it's hand...
Nifty! I'll try that.
So the original code in PushZoom and PopZoom was:
busy hold $graph
update
busy release $graph
Are you including any sort of update, or just generating the event? I
also remember the "update considered harmful" issue, and I think it
might apply here. It might make sense to use [update idletasks].
I'll have to play around.
Thanks much,
Bob
1) I am commenting out the busy calls
2) I have commented out the update call as well
good luck !
I tried your trick of Configure <on windows> and it does not work for
me, resizing does work however, I will try other events. (One of my
window is not resizable).
This is not a complete solution however BLTs graph widget updates
without having to generate false events, Is there anyone out there
capable of seeing what has changed in the code ?
Martyn
Sorry it's not working for you, but as said it does for me and I am on
Windows XP using Tcl/Tk 8.5.6 (IRC). I realise this is not a fit and
proper solution, but am hoping this will prompt someone with deeper
insight to determine the real culprit and solution. I will try it on a
non-resizable window tomorrow when back in office.
regards
Julian
Martyn, I am using Tcl/Tk 8.5.6 on WindowsXP. I have made my toplevel
fixed size (using wm resizable . 0 0) and my <Configure> hack still
works (for me)...
Here is the code I am using (exuse any typos, I am hand copying for a
restricted machine to this one)
package require Tk
package require rbc
set g [rbc::graph .g -bd 1 -relief raised - title Demo]
pack $g -fill both -expand yes
wm resizable . 0 0
Rbc_Crosshairs $g
Rbc_ZoomStack $g
Rbc_ActiveLegend $g
$g grid on
rbc::vector create x
rbc::vector create y
x append 1 2 3 4 5
y append 100 20 320 500 50
$g element create xy -xdata x -ydata y -pixels 2
---------------
In graph.tcl I changed as follows
1) In "PopZoom" proc, after "ZoomTitleLast $graph", I commmented out
the "busy" calls and the "update" and inserted the following
event generate $graph <Configure>
2) Similarly, at the very end of the "PushZoom" proc, I commmented out
the "busy" calls and the "update" and inserted the following
event generate $graph <Configure>
3) At the very end of the "ActivateLegend", "DeactivateLegend" and
"HighlightLegend" procs I added the following
event generate $graph <Configure>
Hope this helps
regards
Julian
Julian,
I made these changes and they seemed to work for me on Linux and
Windows. I checked them into svn, along with demos graph1.tcl and
graph3.tcl.
Bob
Your code does work but I still have problems with mine !
package require BLT
package require rbc
set RBC FALSE
proc SplashScreen {} {
global Config NoSplash RBC
set top .splash
set NoSplash FALSE
if {[winfo exists $top]} {return}
# Create a new popup window
toplevel $top -bd 1 -bg white -borderwidth 4 -relief ridge
wm withdraw $top
# Centre the help window on the main window
set wx [expr {([winfo screenwidth .]/2) - ([winfo reqwidth $top])/
2}]
set wy [expr {([winfo screenheight .]/2)- ([winfo reqheight $top])/
2}]
wm geometry $top +$wx+$wy
# Override the window manager (No window bar on top)
wm overrideredirect $top 1
update
set graph $top.g
if {$RBC} {
rbc::graph $graph -height 2i -width 4i -background white
} else {
blt::graph $graph -height 2i -width 4i -background white
}
pack $graph -side bottom -expand y -fill both
# Update to allow the window size to be recovered
wm deiconify $top
# Disallow all resizing
wm resizable $top 0 0
raise $top
focus -force $top
set datav(P) {8 16 0 0 8 16 16 16 12 8 4 8}
set datav(l) {4 8 0 0 8 0}
set datav(o) {12 8 4 8 0 0 8 0 12 8}
set datav(t) {4 8 0 0 4 8 8 8 0 8}
set logo "P l o t"
set positions {0 0 10 0 20 0 35 0}
set max 108
$graph legend configure -hide 1
$graph axis configure x -min -5 -max $max -hide 1 -major "-30 -20
-10 0 10 20 30 40 50 60 70 80 90 100"
$graph axis configure y -min -5 -max 21 -hide 1 -major ""
$graph grid configure -hide 0
bind $top <Button-1> "set NoSplash TRUE"
bind $top <Escape> "set NoSplash TRUE"
set idx 0
foreach el $logo {ox oy} $positions {
if {$NoSplash} {break}
if {$RBC} {
rbc::vector create xvec$idx yvec$idx
} else {
blt::vector create xvec$idx yvec$idx
}
$graph element create plot$idx -xdata xvec$idx -ydata yvec$idx
-linewidth 3 -fill blue -symbol ""
foreach {dx dy} $datav($el) {
set xvec${idx}(++end) [expr {$dx +$ox + 30}]
set yvec${idx}(++end) [expr {$dy +$oy}]
if {$RBC} {
event generate $graph <Configure>
} else {
update
}
after 25
}
incr idx
}
set afterid [after 3000 "set NoSplash TRUE"]
if {$NoSplash != "TRUE"} {
tkwait variable NoSplash
}
grab release $top
destroy $top
# Stop the after if it is still waiting
after cancel $afterid
if {$RBC} {
eval rbc::vector destroy [rbc::vector names *vec*]
} else {
eval blt::vector destroy [blt::vector names *vec*]
}
}
SplashScreen
exit
As I understand it the updte command basically handles any pending
events, so It appears that blt is posting redraw evends which are
handled by the update command but rbc is not posting any events and
the redraw has to be triggered by posting a false redraw event saying
that the display needs to be redrawn !
Martyn
Martyn,
I messed around with your code a bit, and figured out why it wasn't
working. There is a but in RBC.
When you create vectors in a proc, RBC should create a local array
variable. But instead it is creating a global variable. So this code
-should- work.
proc addTrace {graph} {
vector create xvec yvec
$graph create element newtrace -xdata xvec -ydata yvec
for {set i 0} {$i<10} {incr i} {
# this code is correct and should work
set xvec(++end) $i
set yvec(++end) $i
# this code is incorrect but does work with RBC 0.1
set:: xvec(++end) $i
set ::yvec(++end) $i
}
}
(bug reports and maybe fixes to follow.)
Bob
Bob, everything seems ok now I have several places where the -min/-max
are changed and I was looking at the wrong one for the tests.
You were right about the vectors and the global scope, This is also
true for BLT so I do not see how my code worked before, very curious.
Now if some kind soul could have a little peek at the update/Configure
problem.
Martyn
I'm pretty sure that RBC is different from BLT. Since it was supposed
to be a port, and RBC is incompatible, then it is a bug. (Not that I
know how to fix it, yet.)
Bob
Or replace those by [tk busy] ?
Jos.
I suppose that would work for Tk 8.5+ I've lived in 8.4-land for so
long, I forget all the goodies that I'm missing. :-}
Bob
In this case, it's part of 8.6.
Donal.