Re: [clutter] button release not caught if not on actor

2009-06-19 Thread Bartosz Kostrzewa
Rajith Kalluraya wrote:
> Hi,
> 
> You can do a clutter_grab_pointer on the scrollbar widget in its button
> press handler. Motion events and the release events will be received by
> the scrollbar widget no matter where the mouse is.
> 
> Make sure you call clutter_ungrab_pointer in the release handler.
> 
> That should so the trick.
> 

Thanks a lot.

Unfortunately it's just a partial fix even with my workarounds.

I have separate animations for hover (enter/leave - opacity
increase/decrese) and click/release. Now when I grab the pointer, the
enter/leave boundaries become those of the stage, and my hover highlight
stays lit when the mouse button is released outside of the element
boundaries but within the stage boundaries.

I can't "unlight" it in the button_release signal handler because the
pointer might have ended up hovering over the element at the end of the
scrolling operation, so it must remain "lighted". That is, unless there
is a way to check whether the pointer is currently above a given element.

Any more ideas?

-Bartek

-- 
To unsubscribe send a mail to clutter+unsubscr...@o-hand.com



Re: [clutter] button release not caught if not on actor

2009-06-19 Thread Bartosz Kostrzewa
Hi Rajith, thanks a lot. That works even though I would have thought it
to be highly problematic in cluttermm. I'll write down what I did, it
may be useful for someone else in the future.

The signal handlers which initiate the animations on click and release
are in a semi-abstract base class from which I derive the actual
(reactive) elements of my UI. Hence no RefPtrs to them exist. The
problem is that grab_pointer requires to be passed a RefPtr to the actor
which will receive the events.

If I do a:
CustomBaseClass::on_click() {
Clutter::grab_pointer( (Glib::RefPtr ) this );
/* do stuff */
}

the RefPtr created from the this pointer to the class instance will be
decremented when on_click() is left. This causes the destruction of the
CustomBaseClass instance (to which no other RefPtr is pointing). So
that's not an option.

One workaround I thought about is to keep a "self" RefPtr which is
defined in the class constructor:

CustomBaseClass() {
/* init stuff */
self = (Glib::RefPtr ) this;
}

This could then be passed to grab_pointer. I thought that this would be
problem because keeping the RefPtr around would mean that the destructor
of the object will never be called. However, calling stage->remove_all()
[as is currently necessary to clean up properly] apparently causes all
children to be destroyed properly, even though RefPtr is still around.
(on second thought, it seems logical because the RefPtr is a member of
the object being destroyed)

-Bartek


Rajith Kalluraya wrote:
> Hi,
> 
> You can do a clutter_grab_pointer on the scrollbar widget in its button
> press handler. Motion events and the release events will be received by
> the scrollbar widget no matter where the mouse is.
> 
> Make sure you call clutter_ungrab_pointer in the release handler.
> 
> That should so the trick.
> 
> Cheers
> 
> 2009/6/19 Bartosz Kostrzewa mailto:zoom...@runbox.com>>
> 
> I've got a little problem with catching release events. I have a
> scrollbar widget the handle of which animates (slightly) on click and
> release. The problem is that when using scrollbars one often mouses off
> the scrollbar once the handle has been clicked and dragging is in
> progress. This results in the consecutive release event not being caught
> by the scrollbar handle because the pointer is not above it.
> 
> Short of adding special signal handlers for the stage and every single
> scrollbar on the stage, is there a way to make the release event
> propagate to the scrollbar handle's on_release handler? IE: to announce
> to clutter that this particular object is now globally reactive for this
> particular event? (as the event should propagate even if the mouse
> pointer is off-stage, for non-fullscreen applications)


-- 
To unsubscribe send a mail to clutter+unsubscr...@o-hand.com



Re: [clutter] button release not caught if not on actor

2009-06-19 Thread Rajith Kalluraya
Hi,

You can do a clutter_grab_pointer on the scrollbar widget in its button
press handler. Motion events and the release events will be received by the
scrollbar widget no matter where the mouse is.

Make sure you call clutter_ungrab_pointer in the release handler.

That should so the trick.

Cheers

2009/6/19 Bartosz Kostrzewa 

> I've got a little problem with catching release events. I have a
> scrollbar widget the handle of which animates (slightly) on click and
> release. The problem is that when using scrollbars one often mouses off
> the scrollbar once the handle has been clicked and dragging is in
> progress. This results in the consecutive release event not being caught
> by the scrollbar handle because the pointer is not above it.
>
> Short of adding special signal handlers for the stage and every single
> scrollbar on the stage, is there a way to make the release event
> propagate to the scrollbar handle's on_release handler? IE: to announce
> to clutter that this particular object is now globally reactive for this
> particular event? (as the event should propagate even if the mouse
> pointer is off-stage, for non-fullscreen applications)
>
> Thanks for any help you can offer!
> Bartek
> --
> To unsubscribe send a mail to 
> clutter+unsubscr...@o-hand.com
>
>


-- 

Rajith
-
www.pixelfactory.co.in


[clutter] button release not caught if not on actor

2009-06-19 Thread Bartosz Kostrzewa
I've got a little problem with catching release events. I have a
scrollbar widget the handle of which animates (slightly) on click and
release. The problem is that when using scrollbars one often mouses off
the scrollbar once the handle has been clicked and dragging is in
progress. This results in the consecutive release event not being caught
by the scrollbar handle because the pointer is not above it.

Short of adding special signal handlers for the stage and every single
scrollbar on the stage, is there a way to make the release event
propagate to the scrollbar handle's on_release handler? IE: to announce
to clutter that this particular object is now globally reactive for this
particular event? (as the event should propagate even if the mouse
pointer is off-stage, for non-fullscreen applications)

Thanks for any help you can offer!
Bartek
-- 
To unsubscribe send a mail to clutter+unsubscr...@o-hand.com