Re: how to wrk wid colors?

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

 



They way I would implement something like this would be to introduce a
state variable, which would represent which frame to render. Pass the
state to the draw_rect() callback, and draw the contents according to
which state the application is in. Then add a timeout callback, which
updates the state, and calls gtk_widget_queue_draw() on the widget.
Did I mention Cairo ? :)

--Jacob

On Mon, 2006-04-10 at 21:47 +0530, sahlot arvind wrote:
> I want to draw adjacent rectangles of different color wid a time
> delay...
> if i use pixmap then whole of the figure will get up instataneoulsy,
> but i want to show sth like animation...so for that i implemented a
> function to draw rectangle wid color then i used
> g_timeout_add(1000,draw_rect, NULL).. now for each successive call i m
> changing coordinates and alongwid them i m using
> gdk_gc_set_foreground(gc, &color).. i m not doing anything wid
> background color but background color is itself changing to foreground
> color and the lines which are drawing rectangle are of same color as
> that of filled rectangle.. while i want to draw rectangle in BLACK and
> wanna fill it wid RED....
> I am getting any way out so plz help me..
> Thanks and Regards 
> _______________________________________________
> 
> gtk-list@xxxxxxxxx
> http://mail.gnome.org/mailman/listinfo/gtk-list

_______________________________________________

gtk-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gtk-list

[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux