<div dir="ltr">Hello,<div><br></div><div>Without the bind event, pd still have the same behavior. I think that tcl/tk calls the focus method on the object&#39;s &quot;sub-canvas&quot; after the the focus method on parent canvas that why I had the this problem. I have to notify tcl/tk who is the real master (the parent canvas).</div>
<div><br></div><div>Thanks a lot,</div><div><br></div><div>Pierre </div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/10/9 Patrice Colet <span dir="ltr">&lt;<a href="mailto:colet.patrice@free.fr" target="_blank">colet.patrice@free.fr</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<br>
I&#39;m wondering if this strange behavior come from the &lt;%sButtonPress&gt; event, but I didn&#39;t try to compile for trying with my PC...<br>
I use [sys_gui] for running GUI drawing commands, then there is no need for compile, it&#39;s like IOannnes&#39;s suggest but without binary compilation, and without all the sys_vgui() semantic...<br>
May be if you drop a log file with a redirection command like this:<br>
<br>
pd -open patch.pd 2&gt;&amp;1 &gt;&gt; tmp/patch.log<br>
<br>
It might be possible to find what&#39;s happening with tcl.<br>
<br>
Colet Patrice<br>
<br>
----- Mail original -----<br>
&gt; De: &quot;Pierre Guillot&quot; &lt;<a href="mailto:guillotpierre6@gmail.com">guillotpierre6@gmail.com</a>&gt;<br>
&gt; À: <a href="mailto:pd-dev@iem.at">pd-dev@iem.at</a><br>
&gt; Envoyé: Lundi 7 Octobre 2013 21:53:26<br>
&gt; Objet: [PD-dev] Window strange behavior<br>
<div class="HOEnZb"><div class="h5">&gt;<br>
&gt;<br>
&gt;<br>
&gt; Hi,<br>
&gt; I&#39;ve got a strange behavior in my patch with my GUI externals.<br>
&gt;<br>
&gt;<br>
&gt; First, I create a canvas :<br>
&gt;<br>
&gt; sys_vgui(&quot;canvas %s -borderwidth 0 -width %d -height %d \n&quot;,<br>
&gt; x-&gt;e_drawing_id-&gt;s_name, (int)x-&gt;e_rect.width,<br>
&gt; (int)x-&gt;e_rect.height);<br>
&gt;<br>
&gt; Then I bind the mouse to the canvas :<br>
&gt;<br>
&gt; sys_vgui(&quot;bind %s &lt;%sButtonPress&gt; {+pdsend {%s mousedown %%x %%y<br>
&gt; %i}}\n&quot;, x-&gt;e_drawing_id-&gt;s_name, modifiers_list[i],<br>
&gt; x-&gt;e_name_rcv-&gt;s_name, i);<br>
&gt;<br>
&gt; Then I create a window with the canvas :<br>
&gt;<br>
&gt; sys_vgui(&quot;%s create window %d %d -anchor nw -window %s -tags %s<br>
&gt; -width %d -height %d\n&quot;, x-&gt;e_canvas_id-&gt;s_name,<br>
&gt; (int)x-&gt;e_obj.te_xpix + 4, (int)x-&gt;e_obj.te_ypix+ 4,<br>
&gt; x-&gt;e_drawing_id-&gt;s_name, x-&gt;e_window_id-&gt;s_name,<br>
&gt; (int)x-&gt;e_rect.width - 8, (int)x-&gt;e_rect.height - 8);<br>
&gt;<br>
&gt; When I open a patch with the object, everything works fine (my object<br>
&gt; and the patch). But when I reduce the patch and &quot;reopen&quot; it, Pure<br>
&gt; data have a strange behavior : I can&#39;t change the edit mode (with<br>
&gt; crtl + e) anymore until I open a new patch. It seems like the patch<br>
&gt; or the mouse are no more linked. I can&#39;t figure out what append...<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; here the link to file :<br>
&gt;<br>
&gt; <a href="https://github.com/pierreguillot/PdEnhanced/blob/master/Sources/ebox/ebox_window.c" target="_blank">https://github.com/pierreguillot/PdEnhanced/blob/master/Sources/ebox/ebox_window.c</a><br>
&gt;<br>
&gt;<br>
&gt; and to the object (hoa.space) :<br>
&gt;<br>
&gt; <a href="https://github.com/CICM/HoaLibrary/tree/master/PureData/builds" target="_blank">https://github.com/CICM/HoaLibrary/tree/master/PureData/builds</a><br>
&gt;<br>
&gt;<br>
&gt; If anybody can help me or have an idea, I&#39;ll be so grateful. Thanks<br>
&gt; in advance for any help.<br>
&gt;<br>
&gt; Best,<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; Pierre<br>
</div></div><div class="HOEnZb"><div class="h5">&gt; _______________________________________________<br>
&gt; Pd-dev mailing list<br>
&gt; <a href="mailto:Pd-dev@iem.at">Pd-dev@iem.at</a><br>
&gt; <a href="http://lists.puredata.info/listinfo/pd-dev" target="_blank">http://lists.puredata.info/listinfo/pd-dev</a><br>
&gt;<br>
</div></div></blockquote></div><br></div>