Re: Re: Button drag

philippe DALET <[email protected]> Wed, 12 Jun 2019 20:38:16 +0200
Newsgroups gmane.comp.python.wxpython.devel
Message-ID <CAPq9+MNoUPkSJTdXRqNrr--LJ3a-Tv0LTbWPNG=msuhxeTNHAA@mail.gmail.com>
--0000000000002fcf39058b24b80d
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Thanks a lot. It works fine with this generic button.
Philippe

Le lun. 10 juin 2019 =C3=A0 20:42, Robin Dunn <[email protected]> a =C3=A9c=
rit :

> On Saturday, June 8, 2019 at 2:28:35 AM UTC-7, philippe DALET wrote:
>>
>> Hello
>>
>> I try to drag a button with the mouse on a panel.
>>
>> It works fine on win7 (64bits) with wxpython 4.0.6.  py3.7.3
>>
>> On Ubuntu 18.04--16.04  (64bits) with wxpython 4.0.6. GTK2 py3.5 or
>> py3.6, a capturelost event appears, and after my script is out of contro=
l.
>> Only alt+F4 can stop the script.
>>
>
> On X this usually means that something has the mouse captured but doesn't
> release it.
>
>
>
>> if I change the code like this
>>     def OnMouseDown(self, event):
>>         self.btn.CaptureMouse()
>>         self.btn.ReleaseMouse()
>> it works fine.
>>
>> How to avert this event ?
>>
>
>
> It's probable that the native widget itself is doing something with the
> capture, or even that the parent or some other window is stealing the
> capture. I noticed that if I change your sample to use a generic widget
> like wx.lib.buttons.ThemedGenButton that it didn't have any problems.
>
>
> --
> Robin
>
> --
> You received this message because you are subscribed to the Google Groups
> "wxPython-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/wxPython-dev/b15a48f5-1eed-4d86-b959-c1=
c0b7f7b259%40googlegroups.com
> <https://groups.google.com/d/msgid/wxPython-dev/b15a48f5-1eed-4d86-b959-c=
1c0b7f7b259%40googlegroups.com?utm_medium=3Demail&utm_source=3Dfooter>
> .
> For more options, visit https://groups.google.com/d/optout.
>

--=20
You received this message because you are subscribed to the Google Groups "=
wxPython-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/=
wxPython-dev/CAPq9%2BMNoUPkSJTdXRqNrr--LJ3a-Tv0LTbWPNG%3DmsuhxeTNHAA%40mail=
.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--0000000000002fcf39058b24b80d
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Thanks a lot. It works fine with this generic button.<div>=
Philippe</div></div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=
=3D"gmail_attr">Le=C2=A0lun. 10 juin 2019 =C3=A0=C2=A020:42, Robin Dunn &lt=
;<a href=3D"mailto:[email protected]">[email protected]</a>&gt; a =C3=A9cri=
t=C2=A0:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px=
 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div di=
r=3D"ltr">On Saturday, June 8, 2019 at 2:28:35 AM UTC-7, philippe DALET wro=
te:<blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;bord=
er-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir=3D"ltr"><div>=
Hello</div><div><br></div><div>I try to drag a button with the mouse on a p=
anel.</div><div><br></div><div>It works fine on win7 (64bits) with wxpython=
 4.0.6.=C2=A0 py3.7.3</div><div><br></div><div>On Ubuntu 18.04--16.04=C2=A0=
  (64bits) with wxpython 4.0.6. GTK2  py3.5 or py3.6, a capturelost event a=
ppears, and after my script is out of control.</div><div>Only alt+F4 can st=
op the script.<br></div></div></blockquote><div><br></div><div>On X this us=
ually means that something has the mouse captured but doesn&#39;t release i=
t.</div><div><br></div><div>=C2=A0</div><blockquote class=3D"gmail_quote" s=
tyle=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);pad=
ding-left:1ex"><div dir=3D"ltr"><div></div><div>if I change the code like t=
his</div><div>=C2=A0=C2=A0=C2=A0 def OnMouseDown(self, event):<br>=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 self.btn.CaptureMouse()</div><div>=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 self.btn.ReleaseMouse()<br></div><div>=
</div><div></div><div>it works fine.</div><div><br></div><div>How to avert =
this event ?<br></div></div></blockquote><div><br></div><div><br></div><div=
>It&#39;s probable that the native widget itself is doing something with th=
e capture, or even that the parent or some other window is stealing the cap=
ture. I noticed that if I change your sample to use a generic widget like w=
x.lib.buttons.ThemedGenButton that it didn&#39;t have any problems.</div><d=
iv><br></div><div>=C2=A0</div><div>--</div><div>Robin</div><div><br></div><=
/div>

<p></p>

-- <br>
You received this message because you are subscribed to the Google Groups &=
quot;wxPython-dev&quot; group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:[email protected]" target=
=3D"_blank">[email protected]</a>.<br>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/d/msgid/wxPython-dev/b15a48f5-1eed-4d86-b959-c1c0b7f7b259%40googlegroups=
.com?utm_medium=3Demail&amp;utm_source=3Dfooter" target=3D"_blank">https://=
groups.google.com/d/msgid/wxPython-dev/b15a48f5-1eed-4d86-b959-c1c0b7f7b259=
%40googlegroups.com</a>.<br>
For more options, visit <a href=3D"https://groups.google.com/d/optout" targ=
et=3D"_blank">https://groups.google.com/d/optout</a>.<br>
</blockquote></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;wxPython-dev&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:[email protected]">wxPyth=
[email protected]</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/d/msgid/wxPython-dev/CAPq9%2BMNoUPkSJTdXRqNrr--LJ3a-Tv0LTbWPNG%3DmsuhxeT=
NHAA%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">https://group=
s.google.com/d/msgid/wxPython-dev/CAPq9%2BMNoUPkSJTdXRqNrr--LJ3a-Tv0LTbWPNG=
%3DmsuhxeTNHAA%40mail.gmail.com</a>.<br />
For more options, visit <a href=3D"https://groups.google.com/d/optout">http=
s://groups.google.com/d/optout</a>.<br />

--0000000000002fcf39058b24b80d--