[Gambas-user] no MouseMove() event on GTK

Bruce Steers bsteers4 at gmail.com
Tue Dec 21 15:02:57 CET 2021


On Tue, 21 Dec 2021 at 13:35, bb <adamnt42 at gmail.com> wrote:

> On Tue, 2021-12-21 at 03:08 +0000, Bruce Steers wrote:
> > On Mon, 20 Dec 2021 at 16:46, bb <adamnt42 at gmail.com> wrote:
> >
> > > On Tue, 2021-12-21 at 03:13 +1030, bb wrote:
> > > > On Mon, 2021-12-20 at 16:36 +0000, Bruce Steers wrote:
> > > > > On Mon, 20 Dec 2021 at 16:34, Bruce Steers <bsteers4 at gmail.com>
> > > > > wrote:
> > > > >
> > > > > > Hi folks.
> > > > > >
> > > > > > Can't figure this one out...
> > > > > >
> > > > > > I've been working on a filemanager with a redesigned IconView
> > > > > > like
> > > > > > control.
> > > > > > Hit a roadblock though where my control will not fire the
> > > > > > View_MouseMove()
> > > > > > event with GTK.
> > > > > > it's firing View_Draw() as the background image shows from
> > > > > > there.
> > > > > >
> > > > > > on qt i can hold left mouse and drag-select multiple icons
> > > > > > (the
> > > > > > current
> > > > > > bit i've been working on) tried on gtk and discovered
> > > > > > MouseMove
> > > > > > event not
> > > > > > happening :(
> > > > > >
> > > > > > on QT it's working as expected but not on either GTKs :(
> > > > > >
> > > > > > Any clues why this might be?
> > > > > > Many thanks
> > > > > > BruceS
> > > > > >
> > > > >
> > > > > I forgot to mention
> > > > > MyFileView.class is the class of interest
> > > > > BruceS
> > > > >
> > > > > ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
> > > > No real anser, but...
> > > > have you noticed that MouseMove is not raised in GTK for a text
> > > > control
> > > > (in my case a combobox) unless the cursor is already over part of
> > > > the
> > > > text?
> > > > b
> > > 😣️
> > > IGNORE previous completely!
> > >
> >
> > haha okay.
> >
> > i figured the issue out at least (i think).
> >
> > It's because i use Me._Container = $hView
> > it seems the $hView identifier "View" is triggering View_Draw() but
> > not
> > View_MouseMove() on GTK
> > I used
> > Object.Attach(Me._Container, Me, "ViewBox")
> >
> > So I'm now getting ViewBox_MouseMove() and View_Draw()
> > all seems well.
> > BruceS
> >
> > ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
> I have to say that elsewhere I have also? been trapped by giving an
> object a reserved word moniker. Nowadays I always try to use "SELF" or
> (if absolutely necessary) "MY<thing>" as monikers.
> (and if I am forced to use "MY<thing>",it always looks to me like
> "MYLittleDonkey" ... hu, chack, spit!
> cheers
> b
>

I have tended to only use the "My" prefix to classes that are imported
gambas objects i'm re-writing to suit my needs.
(like importing the Message.class and just renaming to MyMessage.class to
stop conflicts)
(Ben gets unknowingly credited as a co-writer for most of my applications
:) lol )

i'm not sure i've hit a reserved word here though.
problem has been using the hidden property Me._Container
without using Me._Container i as not getting the parent class using
Object.Parent(Me) i was getting it's first Child object the scrollview plus
other glitches that using Me._Container fixed.
I guess something (in gtk) is not passing a signal across the objects
properly like qt is.


i love the tricks you can do with names though :)
i have some compound controls where all the objects including the container
all use the same event name.
eg.
$hview = New ScrollView(Me) As "View"
$hButton=New Button($hView) As "View"
$hLabel =New Label($hView) As "View"

Public Sub View_Draw()
If Not Object.Is(Last, "ScrollView") Then Return  ' only do Draw events for
main container

End

Public Sub View_MouseDown()
' Catch mouse up events from all controls as one event

End

Seems to work a treat :)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20211221/d5e0494b/attachment-0001.htm>


More information about the User mailing list