Re: Androwish Label Font

Liste des GroupesRevenir à cl tcl 
Sujet : Re: Androwish Label Font
De : csaba.nemethi (at) *nospam* t-online.de (nemethi)
Groupes : comp.lang.tcl
Date : 28. May 2025, 18:44:12
Autres entêtes
Message-ID : <1017i1c$2lu5$1@tota-refugium.de>
References : 1 2 3 4 5
User-Agent : Mozilla Thunderbird
Am 28.05.25 um 18:38 schrieb undroidwish:
On 5/28/25 12:50, nemethi wrote:
 
... To your question related to the scrollableframe:  Try the following code:
>
foreach class {ScrollableframeMf ScrollableframeCf} isCf {0 1} {
     bind $class <<FingerDown>> \
         [list scrollutil::sf::onButton1  %W %x %y $isCf]
     bind $class <<FingerMotion>> \
         [list scrollutil::sf::onB1Motion %W %x %y $isCf]
     bind $class <<FingerUp>> \
         [list scrollutil::sf::onButtonRelease1 %W $isCf]
}
...
 Csaba, please let's try with Button-2 bindings, since this is what
AndroWish emulates for swipe gestures e.g. when dragging a Text widget,
so your proposal becomes:
 foreach class {ScrollableframeMf ScrollableframeCf} isCf {0 1} {
      bind $class <2> \
          [list scrollutil::sf::onButton1  %W %x %y $isCf]
      bind $class <B2-Motion> \
          [list scrollutil::sf::onB1Motion %W %x %y $isCf]
      bind $class <ButtonRelease-2> \
          [list scrollutil::sf::onButtonRelease1 %W $isCf]
}
 The <<Finger...>> virtual events are more complex since they allow
for multi touch and pressure.
 See https://androwish.org/home/wiki?name=sdltk+command for more
detailed information.
 Hope this helps,
Christian
Many thanks, Christian!  In the meantime I have found out why my proposed solution fails and how to make it work, but your proposal to use Button-2 bindings rather than <<Finger...>> virtual events appears to be the better solution (I didn't know that the swipe gestures emulate <Button-2>, <B2-Motion> and <ButtonRelease-2> events).
Just for completeness, here is my corrected solution using <<Finger...>> events:
foreach class {ScrollableframeMf ScrollableframeCf} isCf {0 1} {
     bind $class <<FingerDown>> { set motionCount 0 }
     bind $class <<FingerMotion>> [format {
         if {[incr motionCount] == 1} {
             scrollutil::sf::onButton1 %%W %%x %%y %d
         } else {
             scrollutil::sf::onB1Motion %%W %%x %%y %d
         }
     } $isCf $isCf]
     bind $class <<FingerUp>> [list scrollutil::sf::onButtonRelease1 %W $isCf]
}
If I understand the manual correctly, <<FingerDown>> events have no %x and %y fields, hence the scrollutil::sf::onButton1 proc is now invoked on the first <<FingerMotion>> rather than on the <<FingerDown>> event. This makes the trick.  But, as said, your proposal is in IMHO the better one.
--
Csaba Nemethi  https://www.nemethi.de  mailto:csaba.nemethi@t-online.de

Date Sujet#  Auteur
27 May 25 * Re: Androwish Label Font12Harald Oehlmann
27 May 25 +- Re: Androwish Label Font1Harald Oehlmann
28 May 25 +* Re: Androwish Label Font9nemethi
28 May 25 i`* Re: Androwish Label Font8undroidwish
28 May 25 i `* Re: Androwish Label Font7nemethi
28 May 25 i  `* Re: Androwish Label Font6undroidwish
29 May 25 i   `* Re: Androwish Label Font5nemethi
29 May 25 i    `* Re: Androwish Label Font4nemethi
30 May 25 i     `* Re: Androwish Label Font3undroidwish
31 May 25 i      `* Re: Androwish Label Font2nemethi
31 May 25 i       `- Re: Androwish Label Font1undroidwish
2 Jun08:17 `- Re: Androwish Label Font1Harald Oehlmann

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal