Hi, I've got a strange behavior in my patch with my GUI externals.
First, I create a canvas :
sys_vgui("canvas %s -borderwidth 0 -width %d -height %d \n", x->e_drawing_id->s_name, (int)x->e_rect.width, (int)x->e_rect.height);
Then I bind the mouse to the canvas :
sys_vgui("bind %s <%sButtonPress> {+pdsend {%s mousedown %%x %%y %i}}\n", x->e_drawing_id->s_name, modifiers_list[i], x->e_name_rcv->s_name, i);
Then I create a window with the canvas :
sys_vgui("%s create window %d %d -anchor nw -window %s -tags %s -width %d -height %d\n", x->e_canvas_id->s_name, (int)x->e_obj.te_xpix + 4, (int)x->e_obj.te_ypix+ 4, x->e_drawing_id->s_name, x->e_window_id->s_name, (int)x->e_rect.width - 8, (int)x->e_rect.height - 8);
When I open a patch with the object, everything works fine (my object and the patch). But when I reduce the patch and "reopen" it, Pure data have a strange behavior : I can't change the edit mode (with crtl + e) anymore until I open a new patch. It seems like the patch or the mouse are no more linked. I can't figure out what append...
here the link to file :
https://github.com/pierreguillot/PdEnhanced/blob/master/Sources/ebox/ebox_wi...
and to the object (hoa.space) :
https://github.com/CICM/HoaLibrary/tree/master/PureData/builds
If anybody can help me or have an idea, I'll be so grateful. Thanks in advance for any help.
Best,
Pierre
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256
On 2013-10-07 21:53, Pierre Guillot wrote:
Hi, I've got a strange behavior in my patch with my GUI externals.
First, I create a canvas :
sys_vgui("canvas %s -borderwidth 0 -width %d -height %d \n", x->e_drawing_id->s_name, (int)x->e_rect.width, (int)x->e_rect.height);
unrelated to your actual problem, but how about putting all the tcl/tk code into an external file ('ebox_window.tcl') which defines a few functions that simplify the actual code you have to send via sys_vgui? then initialize it via something like
sys_vgui("source /path/to/ebox_window.tcl")
fgmasd IOhannes
Hello,
I'm wondering if this strange behavior come from the <%sButtonPress> event, but I didn't try to compile for trying with my PC... I use [sys_gui] for running GUI drawing commands, then there is no need for compile, it's like IOannnes's suggest but without binary compilation, and without all the sys_vgui() semantic... May be if you drop a log file with a redirection command like this:
pd -open patch.pd 2>&1 >> tmp/patch.log
It might be possible to find what's happening with tcl.
Colet Patrice
----- Mail original -----
De: "Pierre Guillot" guillotpierre6@gmail.com À: pd-dev@iem.at Envoyé: Lundi 7 Octobre 2013 21:53:26 Objet: [PD-dev] Window strange behavior
Hi, I've got a strange behavior in my patch with my GUI externals.
First, I create a canvas :
sys_vgui("canvas %s -borderwidth 0 -width %d -height %d \n", x->e_drawing_id->s_name, (int)x->e_rect.width, (int)x->e_rect.height);
Then I bind the mouse to the canvas :
sys_vgui("bind %s <%sButtonPress> {+pdsend {%s mousedown %%x %%y %i}}\n", x->e_drawing_id->s_name, modifiers_list[i], x->e_name_rcv->s_name, i);
Then I create a window with the canvas :
sys_vgui("%s create window %d %d -anchor nw -window %s -tags %s -width %d -height %d\n", x->e_canvas_id->s_name, (int)x->e_obj.te_xpix + 4, (int)x->e_obj.te_ypix+ 4, x->e_drawing_id->s_name, x->e_window_id->s_name, (int)x->e_rect.width - 8, (int)x->e_rect.height - 8);
When I open a patch with the object, everything works fine (my object and the patch). But when I reduce the patch and "reopen" it, Pure data have a strange behavior : I can't change the edit mode (with crtl + e) anymore until I open a new patch. It seems like the patch or the mouse are no more linked. I can't figure out what append...
here the link to file :
https://github.com/pierreguillot/PdEnhanced/blob/master/Sources/ebox/ebox_wi...
and to the object (hoa.space) :
https://github.com/CICM/HoaLibrary/tree/master/PureData/builds
If anybody can help me or have an idea, I'll be so grateful. Thanks in advance for any help.
Best,
Pierre _______________________________________________ Pd-dev mailing list Pd-dev@iem.at http://lists.puredata.info/listinfo/pd-dev
Hello,
Without the bind event, pd still have the same behavior. I think that tcl/tk calls the focus method on the object's "sub-canvas" 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).
Thanks a lot,
Pierre
2013/10/9 Patrice Colet colet.patrice@free.fr
Hello,
I'm wondering if this strange behavior come from the <%sButtonPress> event, but I didn't try to compile for trying with my PC... I use [sys_gui] for running GUI drawing commands, then there is no need for compile, it's like IOannnes's suggest but without binary compilation, and without all the sys_vgui() semantic... May be if you drop a log file with a redirection command like this:
pd -open patch.pd 2>&1 >> tmp/patch.log
It might be possible to find what's happening with tcl.
Colet Patrice
----- Mail original -----
De: "Pierre Guillot" guillotpierre6@gmail.com À: pd-dev@iem.at Envoyé: Lundi 7 Octobre 2013 21:53:26 Objet: [PD-dev] Window strange behavior
Hi, I've got a strange behavior in my patch with my GUI externals.
First, I create a canvas :
sys_vgui("canvas %s -borderwidth 0 -width %d -height %d \n", x->e_drawing_id->s_name, (int)x->e_rect.width, (int)x->e_rect.height);
Then I bind the mouse to the canvas :
sys_vgui("bind %s <%sButtonPress> {+pdsend {%s mousedown %%x %%y %i}}\n", x->e_drawing_id->s_name, modifiers_list[i], x->e_name_rcv->s_name, i);
Then I create a window with the canvas :
sys_vgui("%s create window %d %d -anchor nw -window %s -tags %s -width %d -height %d\n", x->e_canvas_id->s_name, (int)x->e_obj.te_xpix + 4, (int)x->e_obj.te_ypix+ 4, x->e_drawing_id->s_name, x->e_window_id->s_name, (int)x->e_rect.width - 8, (int)x->e_rect.height - 8);
When I open a patch with the object, everything works fine (my object and the patch). But when I reduce the patch and "reopen" it, Pure data have a strange behavior : I can't change the edit mode (with crtl + e) anymore until I open a new patch. It seems like the patch or the mouse are no more linked. I can't figure out what append...
here the link to file :
https://github.com/pierreguillot/PdEnhanced/blob/master/Sources/ebox/ebox_wi...
and to the object (hoa.space) :
https://github.com/CICM/HoaLibrary/tree/master/PureData/builds
If anybody can help me or have an idea, I'll be so grateful. Thanks in advance for any help.
Best,
Pierre _______________________________________________ Pd-dev mailing list Pd-dev@iem.at http://lists.puredata.info/listinfo/pd-dev