Re: Re-drawing GtkDrawingArea surface on motion-notify-event

2017-03-20 Thread rbd
Hello Marcin, I have written a number of gtk3 apps that perform the type of rubberband line drawing you have described. Although I was originally porting apps from an Xlib drawing environment where XOR was available to do lightning-fast 'undraws' of existing line segments and was skeptical

Detect user idle time or inactivity

2017-03-20 Thread Rúben Rodrigues
Hi guys, There is any way to detect user inactivity in my application? Thanks Ruben ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: drawing GtkDrawingArea surface on motion-notify-event

2017-03-20 Thread Eric Cashon via gtk-app-devel-list
Hi Marcin, One approach is to use a GtkOverlay. Draw the shape on the top and then save the coordinates of the shape if it is what you want. Then you can draw the saved shapes on the lower drawing area.

Re: Re-drawing GtkDrawingArea surface on motion-notify-event

2017-03-20 Thread Dov Grobgeld
The key is to not draw directly, but to invalidate one or more rectangles needed to for changing the image from the old to the new one. I worked on this problem some years ago and I think my solution is very relevant to your question. See the gtk3 branch at: https://github.com/dov/dovtk-lasso .

Re-drawing GtkDrawingArea surface on motion-notify-event

2017-03-20 Thread Marcin Kolny
Hi everyone, I'd like to write very simple application for drawing lines. 1) User press button - app saves x and y coordinates 2) User moves the mouse - app dynamically draws potential line on each mouse move event 3) User releases button - app "saves" the line on the canvas. I've tried to

Re: Best practise inheritance

2017-03-20 Thread Joël Krähemann
Hello Mr. Jacobi What I personally like to see is doing events. It makes your OOP extensible. And is the usual way how things are done in GUI programming. But it is not limited to GUI. For instance this event is handled by a GUI callback to toggle a button.

Re: Best practise inheritance

2017-03-20 Thread Joël Krähemann
Hi You don't have to use myWidget->parent since you dereference the pointer. A pointer to a struct always points to the first field of the topmost nesting level. so it would be: gtk_widget_set_name(myWidget); Bests, Joël On Mon, Mar 20, 2017 at 6:29 PM, S. Jacobi

Re: Best practise inheritance

2017-03-20 Thread S. Jacobi
On Mon, 20 Mar 2017 18:10:16 +0100 Joël Krähemann wrote: > Hi > > As Tristan told you. The struct contains the other struct as not using > a pointer. > > struct MyCompositeWidget > { > GtkAlignment alignment; > > GtkBox *box; > }; > The parent-is-a-pointer mistake

Re: Best practise inheritance

2017-03-20 Thread S. Jacobi
On Mon, 20 Mar 2017 16:01:39 + Tristan Van Berkom wrote: > > Use instance private data, this will not need any priv pointer and > can be done with th G_DEFINE_TYPE_WITH_PRIVATE() macro, and another > to lookup your private data inside your C file (under

Re: Best practise inheritance

2017-03-20 Thread Joël Krähemann
Hi No, you can talk in C of direct inheritance. Or implementing an interface. As Tristan told you. The struct contains the other struct as not using a pointer. struct MyCompositeWidget { GtkAlignment alignment; GtkBox *box; }; The properties are inherited, too. As long you use

Re: Best practise inheritance

2017-03-20 Thread Tristan Van Berkom
On Mon, 2017-03-20 at 16:36 +0100, S. Jacobi wrote: > First of all, inheritance may be the wrong word here in plain c, but > I > don't know how else to name it. Sorry replied to this from my phone and missed some things... > In different projects I see different approaches how to derive custom >

Re: Best practise inheritance

2017-03-20 Thread Tristan Van Berkom
Hi > On Mar 20, 2017, at 3:36 PM, S. Jacobi wrote: > > First of all, inheritance may be the wrong word here in plain c, but I > don't know how else to name it. > > In different projects I see different approaches how to derive custom > widgets from existing ones. I

Best practise inheritance

2017-03-20 Thread S. Jacobi
First of all, inheritance may be the wrong word here in plain c, but I don't know how else to name it. In different projects I see different approaches how to derive custom widgets from existing ones. I can roughly group them into 2 to 3. 1) The header only has a typedef to make the struct

Re: Cross platform developmentG

2017-03-20 Thread Nicola Fontana
Il Mon, 20 Mar 2017 03:30:54 +0100 Dirk Gottschalk via gtk-app-devel-list scrisse: > ... > I'll take a look at this. The question was which DLLs are nedded. Hi, in my cross-compiled installer script [1] I've the following list: File