Hello everyone, 

I'm just testing out some features in LiTE and I do not understand why my
label is not being updated.  Here is the sample code (update_clock is in a
loop): 

void init_clock( LiteWindow *window, LiteLabel *label, DFBRectangle rect,
char *clock_data )
{
        DFBResult res;
        //Time Functions
        time_t now;                     // Our current time
        struct tm *Tm;          // Our Time structure
        now = time( &now );     // Get current time
        Tm = localtime( &now ); // Parse time data
        strftime( clock_data, 10, "%H:%M:%S", Tm );  //Convert time to
string
        
        /* setup label */
        //rect.x = 255; rect.y = 17; 
        res = lite_new_label( LITE_BOX(window) ,&rect, liteNoLabelTheme, 12,
&label );
        lite_set_label_text( label, clock_data );
}


void update_clock( LiteWindow *window, LiteLabel *label, char *clock_data )
{
        DFBRegion reg_clock;
        reg_clock.x1 = 255; reg_clock.y1 = 4; reg_clock.x2 = 315;
reg_clock.y2 = 16;

        time_t now;                     // Our current time
        struct tm *Tm;          // Our Time structure
        now = time( &now );
        Tm = localtime( &now );
        strftime( clock_data, 10, "%H:%M:%S", Tm );

        lite_set_label_text( label, clock_data );

        //lite_draw_box( LITE_BOX(window), &reg_clock, true );
        lite_update_box( LITE_BOX(window), NULL );
}


V/R,
B.



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

Reply via email to