>
> Not really, maybe i have to explain in more detail. I just want to program an 
> simple imageviewer.
> I' got an primary_surface, a image_surface and 2 button_surfaces. My aim is, 
> if i click on the
> forward button_surface, then the image_surface will be flip. It would be very 
> easy, if there is something
> like an GetID, but just for surface. Unfortunately GetID is just for windows. 
> Or do you know a way, how
> i can program something simple like
> (pseudo code)
>                if (event.type == DIET_BUTTONPRESS)
>                        {
>                                if (event.button == DIBI_LEFT)
>                                        {
>                                                            if(event.surface 
> == forward_surface)
>                                                                             
> then ...... flip image_surface ......
>                                        }
>
>                       }

Well, you can check the current position of cursor. Do you know
positions of your surfaces (widgets)?
There is the helpful macros DFB_RECTANGLE_CONTAINS_POINT() for these cases.

And I advice you to use for your widgets only subsurfaces of the
primary surface. The DSCAPS_SUBSURFACE flag.

Secondly, perhaps you should use one of widget libraries to develop UI
without troubles.

For instance, LiTE  (http://www.directfb.org/index.php?path=Platform%2FLiTE)

Or my port of FLTK  ;-)   (main site http://fltk.org)

-- 
Best Regards
Nikita Egorov
[email protected]
[email protected]
_______________________________________________
directfb-users mailing list
[email protected]
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-users

Reply via email to