Events and surface

Hi,

As far as I know, Events always refers to the main surface which represents
in general your surface on the screen. But is there a way to separate the
events to diferrent surface which appears on the screen ? I mean i have 2
surfaces at the same time on the screen, but both have different behaviour.
So at the moment the only thing i can do is get the coordinates and
comparate them in order to know in which surface the events apears. But it
would be great if events were attached to a surface so that you could work
differently with them !

I hope everybody understand

Bye
Lawouach

Hi,

As far as I know, Events always refers to the main surface which represents
in general your surface on the screen. But is there a way to separate the
events to diferrent surface which appears on the screen ? I mean i have 2
surfaces at the same time on the screen, but both have different behaviour.

You have to find what events should correspond to which surface yourself.
Essentially you want window-manager functionality for your surfaces.
There are several libraries which are able to do this on top of SDL. Any
volunteers for this kind of code?

See ya,
-Sam Lantinga, Lead Programmer, Loki Entertainment Software

What kind of libraries ?
It would be really interesting ! In fact i thought about that because i’m
using Gtk (i did yeah, but i cheat a bit ;)) and the system Gtk uses is
really interesting as the signal are connected to the Widget which produced
them. So that the code is really more efficient and clear in think. But
maybe it’s tottaly useless what I am tlaking about for others !

Please Sam tell me more about the way to make it real anyway !++
Lawouach

“Sam Lantinga” a ?crit dans le message news:
E13Rklq-0007as-00 at roboto.devolution.com

Hi,

As far as I know, Events always refers to the main surface which
represents

in general your surface on the screen. But is there a way to separate
the

events to diferrent surface which appears on the screen ? I mean i have
2

surfaces at the same time on the screen, but both have different
behaviour.

You have to find what events should correspond to which surface yourself.
Essentially you want window-manager functionality for your surfaces.
There are several libraries which are able to do this on top of SDL. Any
volunteers for this kind of code?

See ya,
-Sam Lantinga, Lead Programmer, Loki Entertainment Software