From: JHJL on
On Oct 21, 4:34 pm, MSEdit <mse...(a)gmail.com> wrote:
> Hi,
>
> 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
From: JHJL on
On Oct 21, 4:59 pm, JHJL <j...(a)hippospace.com> wrote:
> On Oct 21, 4:34 pm, MSEdit <mse...(a)gmail.com> wrote:
>
> > Hi,
>
> > 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


From: Bob Techentin on
On Oct 22, 4:38 am, JHJL <j...(a)hippospace.com> wrote:
> 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>
>

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
From: MSEdit on
Thanks Julian,

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
From: Bob Techentin on
On Oct 22, 7:54 am, MSEdit <mse...(a)gmail.com> wrote:
> Thanks Julian,
>
> Your code does work but I still have problems with mine !

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