Re: GDK/Cairo question



On Wed, May 18, 2011 at 03:50:57PM -0700, Fabian Greffrath wrote:

Unfortunately not. :(

Maybe something similar to what you are trying to do could work - with
considerable effort.  But it is completely upside down from the point of
view how normal Gtk+ applications work.

Gtk+ runs an event loop (executed by gtk_main()), not you.

You only set up things to be done in response to various events and
signals, usually by means of g_signal_connect().

Drawing is normaly done in "expose-event" signal handler or, in Gtk+ 3,
in "draw" handler.  These signals are emitted when Gtk+ finds the widget
needs to be (re)drawn and you simply draw them in response.

Please look at the hello world Gtk+ examples to see how the main loop
works

Yeti


P.S.: This cannot hapen:

  if (!win)

GLib would abort the program if a new object could not be allocated.



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