Re: Forcing Image redraw
- From: Simon Fuhrmann <simonfuhrmann gmx de>
- To: jody <jody xha gmail com>
- Cc: gtkmm-list gnome org
- Subject: Re: Forcing Image redraw
- Date: Tue, 13 Jan 2009 23:31:45 +0100
Hi!
As far as I know it is generally a bad thing to call any Gtk function
from a thread but the main thread (where the toolkit lives). I suggest
to store the pixbuf at some common place, notify the main thread about
updated data (use Glib::Dispatcher for that), and set the image in the
main thread.
Hope that helps,
Simon
jody wrote:
> Hi
> I have a gtkmm application containing a Gtk::Image.
> In a different thread a pixbuf is created at irregular
> but frequent intervals and the image's set()-method with this pixbuf is called
>
> The thread has knowledge of the applications Gtk:Window (m_pWin)
> and of the Gtk::Image (m_pImg). After having created the Pixbuf and
> set it i do the following:
>
> m_pImg->queue_draw();
>
> Glib::RefPtr<Gdk::Window> win = m_pWin->get_window();
> if (win != NULL) {
> Gdk::Rectangle r(0, 0, iW, iH);
> win->invalidate_rect(r, false);
> }
>
> But the image is only refreshed whenever i move the mouse.
> Is there any way i can really force the image to be repainted immediately
> after i fill its PixBuf?
>
> Thank You
> Jody
> _______________________________________________
> gtkmm-list mailing list
> gtkmm-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtkmm-list
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]