Re: deprecated gtk_cairo_create

2017-01-06 Thread Jim Charlton
ideas mentioned in "the deprecated gtk_cairo_create()" thread. 1. On-screen drawing in Drawing Area against GTK+3 is much more easy than in GTK+2. But this simplification has been achieved by significant changes in API. In particular, the GtkWidget::draw signal is quite different from Gt

Re: deprecated gtk_cairo_create

2017-01-06 Thread Sergei Kolomeeyets
Hi, Emmanuele thanks for your help in last days of last year. Well, in the attachment there are codes of the (perhaps) simplest usage of Drawing Area widget. It goes without gdk_window_create_similar_surface. I'd like to summarize several ideas mentioned in "the deprecated gtk_ca

Re: deprecated gtk_cairo_create

2016-12-30 Thread rbd
On Fri, 30 Dec 2016, cecas...@aol.com wrote: Hi Roger, Would this be similar to using a GtkLayout and a GtkDrawingArea? If you add a drawing area to a layout you get draw scrolling and the layout can update the part of the drawing area shown on the screen even though the drawing might be on a

Re: deprecated gtk_cairo_create

2016-12-30 Thread Eric Cashon via gtk-app-devel-list
Message- From: rbd To: gtk-app-devel-list Sent: Fri, Dec 30, 2016 12:24 pm Subject: Re: deprecated gtk_cairo_create Hello Sergei, Unfortunately the use of the gtk3 DrawingArea is a bit obscure and difficult to figure out. However, I have been able to make use of it very effectively in

Re: deprecated gtk_cairo_create

2016-12-30 Thread rbd
Hello Sergei, Unfortunately the use of the gtk3 DrawingArea is a bit obscure and difficult to figure out. However, I have been able to make use of it very effectively in conjunction with Cairo drawing ops. For various reasons I have created a GUI toolkit library which lies between my app cod

Re: deprecated gtk_cairo_create

2016-12-30 Thread Emmanuele Bassi
Hi; On 30 December 2016 at 13:45, Colomban Wendling wrote: > [1] which says "CairoContext", but that's a weird lie on the API… not > sure why, maybe the GType has this name so introspection is confused. > Anyway, it's cairo_t. The API reference is generated via gtk-doc, which queries the type f

Re: deprecated gtk_cairo_create

2016-12-30 Thread Emmanuele Bassi
Hi; On 30 December 2016 at 17:25, Jim Charlton wrote: > If one does want to draw into a cairo_surface_t, one can create a cairo > context for drawing? E.g. Yes, that's the expected approach. You either create your own Cairo surface, or you ask GDK to create a similar surface (or similar image

Re: deprecated gtk_cairo_create

2016-12-30 Thread Colomban Wendling
Le 30/12/2016 à 18:25, Jim Charlton a écrit : > If one does want to draw into a cairo_surface_t, one can create a cairo > context for drawing? E.g. > > cairo_t * > cairo_create (/|cairo_surface_t >

Re: deprecated gtk_cairo_create

2016-12-30 Thread Jim Charlton
On 2016-12-30 05:45 AM, Colomban Wendling wrote: Hi, Le 30/12/2016 à 12:20, Sergei Kolomeeyets a écrit : Hi, everyone […] {draw_callback} gboolean draw_callback(GtkWidget *area, GdkEventExpose *event, GArray *ptLinePoints) { That's not the right signature for the GtkWidget::draw signal: it t

Re: deprecated gtk_cairo_create

2016-12-30 Thread Colomban Wendling
Le 30/12/2016 à 15:09, Sergei Kolomeeyets a écrit : > Hi, Colomban > Thanks a lot for you hint! I realised the idea of wrong event hanling. > Do you mean that I SHOULD DO NOTHING to create a cairo context BECAUSE > IT IS in the draw event callback function obligatory parameters? And, if > yes, I co

Re: deprecated gtk_cairo_create

2016-12-30 Thread Colomban Wendling
Hi, Le 30/12/2016 à 12:20, Sergei Kolomeeyets a écrit : > Hi, everyone > […] > > {draw_callback} > > gboolean draw_callback(GtkWidget *area, GdkEventExpose *event, GArray > *ptLinePoints) { That's not the right signature for the GtkWidget::draw signal: it takes a cairo_t* as the second parameter

deprecated gtk_cairo_create

2016-12-30 Thread Sergei Kolomeeyets
Hi, everyone I'm struggling with migration from gtk2. Well gtk_cairo_create is deprecated in gtk3. And it looks the changes are very serious (or I'm sach silly that even do not understand what should I do instead of it ). Is there anybody who use Drawing Area in GTK3 and can explain the right way