Tutorial for writing widgets in Gtk3

2018-07-26 Thread Göran Hasse
Hello! I try to write a custom widget in Gtk3. I study the source for other widgets but I find no totorial for how to write a widget in Gtk3. (There was for Gtk2 - but they are not of any use anymore...). Is there no interest in Gtk3 anymore? I find it very hard to find tutorials for Gtk3. /g

Re: Tutorial for writing widgets in Gtk3

2018-07-26 Thread Timm Bäder
On 2018-07-26 09:42, Göran Hasse wrote: Hello! I try to write a custom widget in Gtk3. I study the source for other widgets but I find no totorial for how to write a widget in Gtk3. (There was for Gtk2 - but they are not of any use anymore...). Is there no interest in Gtk3 anymore? I find it ve

Re: Tutorial for writing widgets in Gtk3

2018-07-26 Thread Göran Hasse
If you look in the widget_class->draw section MyButton *button = MY_BUTTON(widget); Why is this pointer to button created? It is not used! And where is the cairo_t *cr comming from? This is a turorial that is not so easy to understand... /gh Den 2018-07-26 kl. 08:39, skrev Timm Bäder: > On 20

Re: Tutorial for writing widgets in Gtk3

2018-07-26 Thread Timm Bäder
That pointer is just not used because this is a minimal example that doesn't even do any custom drawing. If you don't use it, don't declare it. The cairo_t gets passed to the draw implementation by GTK+, it's a parameter to the my_button_draw function. See also the documentation for gtk_widget_d

Re: Tutorial for writing widgets in Gtk3

2018-07-26 Thread Eric Cashon via gtk-list
Hi Göran, There are a couple of widgets at https://gitlab.com/cecashon/OrderedSetVelociRaptor/tree/master/Misc that might be of help. They are widgets derived from a drawing area widget. There is a toggle, switch, gauge, multigraph, etc. If you click on the folder there are some pictures an

Re: Tutorial for writing widgets in Gtk3

2018-07-26 Thread Scott Mayo via gtk-list
I’ll second this. Gtk is complex, with three layers (gtk, gdk, g). Then there are separate pieces like pango and Cairo. It’s not obvious how it all fits together and a slew of depreciation makes it hard to untangle. What’s needed is a full blooded example. Start from main and show a pure gtk+3

Re: Tutorial for writing widgets in Gtk3

2018-07-26 Thread Göran Hasse
Hello, This is a common problem with todays "eco-systems". They tend to be so complex so that small firms and singel programmers have problems to coop. Instead of making it simple to create a "simple" program the environment tends to focus on "user experience" and this demands extremly complex

Re: Tutorial for writing widgets in Gtk3

2018-07-26 Thread Rafal Luzynski
26.07.2018 20:21 Scott Mayo via gtk-list wrote: > > I’ll second this. Gtk is complex, with three layers (gtk, gdk, g). Then there > are separate pieces like pango and Cairo. It’s not obvious how it all fits > together and a slew of depreciation makes it hard to untangle. > > What’s needed is a ful