Hi, 

i've modified the code of df_window, after every outcommenting, i've compiled 
and tried to start the program again.
The only important change is that i use for every window an own ID. My problem 
is, that DWET_BUTTONDOWN doesn't
work.  "evt.window_id == id1" is working, i've controlled it. 
Thanks for reading and help.

int main( int argc, char *argv[] )
        {
    IDirectFB              *dfb;
    IDirectFBDisplayLayer  *layer;
    IDirectFBImageProvider *provider;
    IDirectFBWindow        *window1;
    IDirectFBWindow        *window2;
    IDirectFBSurface       *window_surface1;
    IDirectFBSurface       *window_surface2;
    IDirectFBEventBuffer   *buffer;
    DFBDisplayLayerConfig         layer_config;
    DFBWindowID         id1;
    DFBWindowID         id2;
    int err;
    int quit = 0;
    DFBCHECK(DirectFBInit( &argc, &argv ));
    DFBCHECK(DirectFBCreate( &dfb ));
    dfb->GetDeviceDescription( dfb, &gdesc );
    DFBCHECK(dfb->GetDisplayLayer( dfb, DLID_PRIMARY, &layer ));
    layer->SetCooperativeLevel( layer, DLSCL_ADMINISTRATIVE );
    layer->GetConfiguration( layer, &layer_config );
    layer->EnableCursor ( layer, 1 );
    DFBSurfaceDescription desc;
    desc.flags  = DSDESC_WIDTH | DSDESC_HEIGHT | DSDESC_CAPS;
    desc.width  = layer_config.width;
    desc.height = layer_config.height;
    desc.caps   = DSCAPS_SHARED;
    layer->SetBackgroundMode( layer, DLBM_IMAGE );
        {
        DFBSurfaceDescription sdsc;
                DFBWindowDescription  desc;

                desc.flags = ( DWDESC_POSX | DWDESC_POSY |DWDESC_WIDTH | 
DWDESC_HEIGHT );
                desc.caps = DWCAPS_ALPHACHANNEL;
                desc.flags |= DWDESC_CAPS;
                sdsc.width  = 41*2;
                sdsc.height = 27*2;
                desc.posx   = 20;
                desc.posy   = 480-27*2-20;
                desc.width  = sdsc.width;
                desc.height = sdsc.height;

                DFBCHECK(layer->CreateWindow( layer, &desc, &window2 ) );
                window2->GetSurface( window2, &window_surface2 );
                DFBCHECK(dfb->CreateImageProvider( dfb,"backward.png",&provider 
));
                provider->RenderTo( provider, window_surface2, NULL );
                window_surface2->Flip( window_surface2, NULL, 0 );
                provider->Release( provider );
                window2->CreateEventBuffer( window2, &buffer );
                window2->SetOpacity( window2, 0xFF );
                window2->GetID( window2, &id2 );
        }

        {
        DFBWindowDescription desc;
        
                desc.flags  = ( DWDESC_POSX | DWDESC_POSY |DWDESC_WIDTH | 
DWDESC_HEIGHT | DWDESC_CAPS );
                desc.posx   = 640-41*2-20;
                desc.posy   = 480-27*2-20;
                desc.width  = 41*2;
                desc.height = 27*2;
                desc.caps   = DWCAPS_ALPHACHANNEL;

                DFBCHECK(layer->CreateWindow( layer, &desc, &window1 ) );
                window1->GetSurface( window1, &window_surface1 );
                DFBCHECK(dfb->CreateImageProvider( dfb,"forward.png",&provider 
));
                provider->RenderTo( provider, window_surface1, NULL );
                window_surface1->Flip( window_surface1, NULL, 0 );
                provider->Release( provider );
                window1->AttachEventBuffer( window1, buffer );
                window1->SetOpacity( window1, 0xFF );
                window1->GetID( window1, &id1 );
        }
        while (!quit) 
                {
                DFBWindowEvent evt;
                buffer->WaitForEvent(buffer);
                while (buffer->GetEvent( buffer, DFB_EVENT(&evt) ) == DFB_OK) 
                        {
                        if (evt.type == DWET_ENTER)
                                {
                                if (evt.window_id == id1)
                                        {
                                                if (evt.type == DWET_BUTTONDOWN)
                                                {                               
                                                                
                                                        
DFBCHECK(dfb->CreateImageProvider( dfb,"about.jpg",&provider ));
                                                        provider->RenderTo( 
provider, window_surface1, NULL );
                                                        window_surface1->Flip( 
window_surface1, NULL, 0 );
                                                }
                                        }
                                }
                        }
                }
     buffer->Release( buffer );
     window_surface2->Release( window_surface2 );
     window_surface1->Release( window_surface1 );
     window2->Release( window2 );
     window1->Release( window1 );
     layer->Release( layer );
     dfb->Release( dfb );
     return 42;
}


__________________________________________________________________________
Verschicken Sie SMS direkt vom Postfach aus - in alle deutschen und viele 
ausländische Netze zum gleichen Preis! 
https://produkte.web.de/webde_sms/sms



_______________________________________________
directfb-users mailing list
directfb-users@directfb.org
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-users

Reply via email to