Display invisible



Hello,
I have a problem. I am simulating an environment where at regular intervals some fixed number of objects needs to be displayed at specified co-ordinates.

1.I have struture "multi_struct.h", which can hold 256 objects.

2.I have a c pgm "multi.c" where i have populated the structure.

3.I have sample.c pgm(this is the main program)
3.1 Here i have a main window.
3.2 I have a vertical box and horizontal box in main window
3.3 The horizontal box holds nothing but two labels "IMAGE WINDOW" and "TEXT WINDOW"
3.4 The vertical box has table
3.5 The table has a fixed_container and text box.(i have used a fixed_cont_dummy initially so that the seperation will be seen. the fixed container has a background image...a green circle with x and y axis 2.xpm
3.6 Then i have a time out function gtk_timeout_add(500,display_fun, NULL)
3.7 so the display_fun is called every 500msec.
In display_fun
**************
1. I create a fixed_cont and put it in table(over the fixed_cont_dummy, which is in turn in a table in the same column..i mean overlap).
2. Then i have a "for loop" where i mention the number of objects to be display.
3. all the objects i have are created in GIMP. they are *.png files.
4. i render them using gdk_pixbuf and load it in mage. then i put that image in fixed_cont in specific co-ordinated, that is alreday set in multi_struct.
5. i put the image in event_box so then when i cilck over the image i call a "print" funct that will print info related to it.(this also i ahve given in the structure)
I call this display_fun every 500msec. and everytime i increment the x and y co-ordinates by 5.
x = x
y = y
after 8 increments i destroy the image, event_box and fixed cont
2. The time_out function is called like this indefinitely.
Now what happens is that when i have, say 25 images to display....the images are displayed(shown on thescreen) only for some 15 min, after that the nothing is visible in screen. but when i give a print statement inside "for loop"..i can see the print statement on the screen, being printed every time the display_fun is called. but as i said above the images on the screen disappears after 10 or 15 minutes. if i increase the number of images say 100, then the time the images are visble in the sceen decreases and the images don't show at all. but i am sure that the display_fun is called every time as
time_out call is executed, because i just print an see some thing. why is the display behaving so.....

I have attached the main pgm sample.c, and mutli_struct.h where i have structure declaration. . 

 you can substitute and see any image where the names are mentioned.

i execute the function like this
gcc sample.c -o sample `gnome-config --cflags --libs gdk_pixbuf`
i use
gtk+1.2.8-7
gdk-pixbuf-0.8.0-5
gcc-2.96
Is my approach wrong...
Am i doing some very absurd mistake here....
Please let me know ......
With regards
Akila


The new MSN 8: smart spam protection and 2 months FREE*

Attachment: sample.c
Description: Text document

Attachment: multi_struct.h
Description: Text document



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]