<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:14pt"><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 14pt; ">Hello,</div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 14pt; "><br></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 14pt; ">What is the tip/trick to get working mouse events on Mac. It is working perfectly in Linux and Windows.</div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 14pt; "><br></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 14pt; ">Basically the MaceTk.tcl is not working well, allways happend if you add vtkTkRenderWidget.</div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 14pt; "><br></div><div><font class="Apple-style-span" face="'times new
roman', 'new york', times, serif" size="4">The terminal says "</font><font class="Apple-style-span" face="'times new roman', 'new york', times, serif"><span class="Apple-style-span" style="font-size: 19px;"> invalid drawable".</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif"><span class="Apple-style-span" style="font-size: 19px;"><br></span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif"><span class="Apple-style-span" style="font-size: 19px;">Any idea, thanks??</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif"><span class="Apple-style-span" style="font-size: 19px;"><br></span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif"><span class="Apple-style-span" style="font-size: 19px;">This the code :</span></font></div><div><font
class="Apple-style-span" face="'times new roman', 'new york', times, serif"><span class="Apple-style-span" style="font-size: 19px;"><br></span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif"><div><span class="Apple-style-span" style="font-size: 19px;"> </span></div></font><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif"><span class="Apple-style-span" style="font-size: 19px;"><br></span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;">package require vtk</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;">package require vtkinteraction</span></font></div><div><font class="Apple-style-span" face="'times new roman',
'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;"><br></span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;">set sphere_max_res 60</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;">set sphere_init_res 8</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;">vtkSphereSource sphere</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;"> sphere SetThetaResolution
$sphere_init_res</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;"> sphere SetPhiResolution $sphere_init_res</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;"><br></span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;"><br></span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;">vtkPolyDataMapper sphereMapper</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span
class="Apple-style-span" style="font-size: 19px;"> sphereMapper SetInputConnection [sphere GetOutputPort]</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;"><br></span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;">vtkLODActor sphereActor</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;"> sphereActor SetMapper sphereMapper</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;"><br></span></font></div><div><font
class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;"><br></span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;">vtkConeSource cone</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;"> cone SetResolution 6</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;"><br></span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;"><br></span></font></div><div><font
class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;">vtkGlyph3D glyph</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;"> glyph SetInputConnection [sphere GetOutputPort]</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;"> glyph SetSource [cone GetOutput]</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;"> glyph SetVectorModeToUseNormal </span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york',
times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;"> glyph SetScaleModeToScaleByVector </span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;"> glyph SetScaleFactor 0.25</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;"><br></span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;">vtkPolyDataMapper spikeMapper</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;"> spikeMapper
SetInputConnection [glyph GetOutputPort]</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;"><br></span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;">vtkLODActor spikeActor</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;"> spikeActor SetMapper spikeMapper</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;"><br></span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span
class="Apple-style-span" style="font-size: 19px;">vtkRenderer renderer</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;"> renderer AddActor sphereActor</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;"> renderer AddActor spikeActor</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;"> renderer SetBackground 1 1 1</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;"><br></span></font></div><div><font
class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;">vtkRenderWindow renWin</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;"> renWin AddRenderer renderer</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;"><br></span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;">set vtkw [vtkTkRenderWidget .ren \</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size:
19px;"> -width 300 \</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;"> -height 300 \</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;"> -rw renWin]</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;"><br></span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;">::vtk::bind_tk_render_widget $vtkw</span></font></div><div><font class="Apple-style-span" face="'times
new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;"><br></span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;">frame .params</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;"><br></span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;">set sth [scale .params.sth \</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;"> -from 3 -to $sphere_max_res -res 1
\</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;"> -orient horizontal \</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;"> -label "Sphere Theta Resolution:" \</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;"> -command setSphereThetaResolution]</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;"><br></span></font></div><div><font class="Apple-style-span"
face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;">$sth set [sphere GetThetaResolution]</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;"><br></span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;">proc setSphereThetaResolution {res} {</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;"> sphere SetThetaResolution $res</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size:
19px;"> renWin Render</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;">}</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;"><br></span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;">set sph [scale .params.sph \</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;"> -from 3 -to $sphere_max_res -res 1 \</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif"
color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;"> -orient horizontal \</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;"> -label "Sphere Phi Resolution:" \</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;"> -command setSpherePhiResolution]</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;"><br></span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span"
style="font-size: 19px;">$sph set [sphere GetPhiResolution]</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;"><br></span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;">proc setSpherePhiResolution {res} {</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;"> sphere SetPhiResolution $res</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;"> renWin Render</span></font></div><div><font class="Apple-style-span" face="'times new
roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;">}</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;"><br></span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;">set cone_max_res $sphere_max_res</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;">set cre [scale .params.cre \</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;"> -from 3 -to $cone_max_res -res 1
\</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;"> -orient horizontal \</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;"> -label "Cone Source Resolution:" \</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;"> -command setConeSourceResolution]</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;"><br></span></font></div><div><font class="Apple-style-span"
face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;">$cre set [cone GetResolution]</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;"><br></span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;">proc setConeSourceResolution {res} {</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;"> cone SetResolution $res</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;">
renWin Render</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;">}</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;"><br></span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;">set gsc [scale .params.gsc \</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;"> -from 0.1 -to 1.5 -res 0.05 \</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span
class="Apple-style-span" style="font-size: 19px;"> -orient horizontal\</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;"> -label "Glyph Scale Factor:" \</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;"> -command setGlyphScaleFactor]</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;">$gsc set [glyph GetScaleFactor]</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size:
19px;"><br></span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;">proc setGlyphScaleFactor {factor} {</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;"> glyph SetScaleFactor $factor</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;"> renWin Render</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;">}</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif"
color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;"><br></span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;">button .params.quit -text "Quit" -command ::vtk::cb_exit</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;"><br></span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;">pack $sth $sph $cre $gsc .params.quit -side top -anchor nw -fill both</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;">pack $vtkw .params -side top -fill both
-expand yes</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;"><br></span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;">wm protocol . WM_DELETE_WINDOW ::vtk::cb_exit</span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;"><br></span></font></div><div><font class="Apple-style-span" face="'times new roman', 'new york', times, serif" color="#0000BF"><span class="Apple-style-span" style="font-size: 19px;">tkwait window .</span></font></div><div><font class="Apple-style-span" color="#0000BF"><br></font></div></div><div style="font-family: 'times new roman', 'new york', times, serif;
font-size: 14pt; "><br></div></div></body></html>