Re: What should be used?



Hi Stefan,

I am also in the process of converting my app from v2 to v3, where I do *lots* of drawing.  So before jumping in, I decided to revisit a drawing example I posted some years ago to first convert it to v3 and its drawing to Cairo.

In the hope of being useful for others, I have posted the converted code here: https://gitlab.com/ivor/GTK3-Cairo

An overview of some of the concepts exampled:
  1. Programmatically generated RGB buffers converted to cairo surface for display
  2. Multiple background surfaces maintained over the lifetime of the program
  3. Copying between Cairo surfaces
  4. Drawing effects based on user input
  5. Fade Transition effect between drawings using the alpha channel
Enhancing this to demonstrate multi-threaded drawing should be a trivial task.

cheers,

richard

On Wed, Jul 29, 2015 at 8:55 AM, Stefan Salewski <mail ssalewski de> wrote:
On Wed, 2015-07-29 at 13:05 +0100, Emmanuele Bassi wrote:
> If you have legacy code that requires disabling double buffering, you
> should probably invest some time into porting it to a proper solution
> integrated with the GTK drawing model;

It would be great if someone could port this example to GTK3:

http://www.cairographics.org/threaded_animation_with_cairo/

Some months ago I was going to port that to Nim to test my GTK3 and
Cairo bindings (https://github.com/StefanSalewski?tab=repositories) and
to have one more example.

But then I discovered that this one seems to be still GTK2, and has
gtk_widget_set_double_buffered(window, FALSE);

I may be able to get that C code to compile with GTK3, but unfortunately
I may not be able to make it a really fine GTK3/Cairo example, so it
would not make much sense to convert it to Nim then.

Does someone know another fine small GTK3/Cairo example (C, C++, Ruby,
Python -- or maybe arbitrary other language) which is not outdated?


_______________________________________________
gtk-list mailing list
gtk-list gnome org
https://mail.gnome.org/mailman/listinfo/gtk-list



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