From: Carsten H. (T. R. <ra...@ra...> - 2004-09-23 01:37:37
|
On Wed, 22 Sep 2004 20:48:18 -0700 Milosz Derezynski <md...@re...> babbled: > Carsten Haitzler (The Rasterman) wrote: > > >On Wed, 22 Sep 2004 15:49:39 -0700 Milosz Derezynski <md...@re...> > >babbled: > > > > > > > >>I've got a question regarding Evas. I am coding a Winamp3/5 WAL skin > >>loader, or at least the UI part of it since it will also require of > >>having a MAKI bytecode interpreter, but that's another topic of course. > >> > >>Basically i'm implementing widgets using custom pixmaps, and the problem > >>that i have is: > >> > >>I'm connecting handlers for all events MOUSE_IN, MOUSE_OUT, MOUSE_DOWN > >>and MOUSE_UP for an Evas_Object. > >> > >>What i need to implement for this particular widget (button) is of > >>course that when the mouse button is kept pressed but the pointer moves > >>outside of the widget's area, the image is restored to the unpressed one > >>(as it's the case with basically every GUI toolkit there is). > >> > >>Now the situation is that after MOUSE_DOWN was called and the mouse > >>button is kept pressed by the user, the MOUSE_IN and MOUSE_OUT events > >>are never being called, and i have no idea how to make the widget > >>receive the appropriate information so it can do the redraw. > >> > >>Any hints on how to accomplish that, or is this a bug in Evas? > >> > >>Attached: Source code of the particular widget. Full source of current > >>state is available at http://linux-media.net/walengine-snapshot-1.tar.gz > >>(It requires GLib, Ecore, Evas, libxml2) > >> > >> > > > >actually... what u have is not a bug.. its an explicit FEATURE. as long as > >mouse buttons are down the mouse is GRABBED to the object(s) it went down on > >and keeps reporting mouse moves to those grabbed objects until the mouse > >buttons are raised. THEN it gets a mouse out just after the mouse up. > >basically i've left it up to the programmer to deal with this in the mouse > >motion events. you can check each motion event if the mouse is within, or > >outside the bounds o the object and then know if its in our out yourself. > >basically the mouse is still VIRTUALLY in the object (not physically) - so > >until it is both virtually and physically outside.. u wont get an out. :) > > > >:) > > > > > > > yes that makes much more sense actually :) > > but it is not obvious to me how i can retrieve the particular event > structure inside the callback... i checked the docs and include files, > also the evas source but i can't find it. how do i need to do that? oh - that's easy example: static void _ibar_cb_bar_move(void *data, Evas *e, Evas_Object *obj, void *event_info) { Evas_Event_Mouse_Move *ev; IBar_Bar *ibb; ev = event_info; ibb = data; _ibar_motion_handle(ibb, ev->cur.canvas.x, ev->cur.canvas.y); _ibar_timer_handle(ibb); } rinse and repeat for other event types (different event info structs for each - see Evas.h) :) -- ------------- Codito, ergo sum - "I code, therefore I am" -------------- The Rasterman (Carsten Haitzler) ra...@ra... 裸好多 ra...@de... Tokyo, Japan (東京 日本) |