In addition, what other topic is necessary for the tutorial for beginners?
I’m not an expert, I’m studying gtk4 at present and My knowledge about gtk4 is limited.
Therefore, your advice from the view of whole gtk4 is welcome.
Any other advice and/or suggestion is also appreciated.
I(m sorry if this topic is not appropriate for gnome discource.
Ui file and GtkBuilder would be nice because I do not really cover that in my GTK4 book yet. And maybe you can try to explain if/how Glade can be used with GTK4, as many people seem to like Glade.
And of course it would be nice if you could proof read my book. You may push issues or suggestions to github issue tracker.
[EDIT]
And explaining how users can best install GTK4 when package managers do not yet have GTK4. And how GTK4 can be best installed on Windows and Mac. And how users can debug their apps, how they can use valgrind and debug crashes.
I’ve already written about Ui files and GtkBuilder in my tutorial.
I would like to write about Glade, but maybe in the future.
Because gtk4 is really new and Glade might not work on gtk4 now, mightn’t it?
I will write how to install gtk4 on ubuntu soon.
However, I don’t know about windows and macos unfortunately.
So, it is impossible for me to write the installation to them.
If someone write them and add them to my tutorial, it is really helpful.
Anyway, thank you very much Stefan.
I will read your book soon.
A tutorial about drawing in GTK 4 could be useful: https://blog.gtk.org/2020/04/24/custom-widgets-in-gtk-4-drawing/
I am still using Cairo (“Drawing the old-fashioned way”), but the advice seems now to use GtkSnapshot. They talk also about textures. And there is a gtk_snapshot_append_cairo() function which interests me in my own project because PLplot is offering a Cairo driver.
At the end, we should have a section that build an application from the scratch based on concepts we cover. For example, Image Viewer, Text Editor, To Do, Note taking app, or Markdown Editor. This way, we know how to use concepts cover earlier in tutorial in action.
This virtual function is used to draw the widget itself.
Therefore, it is necessary when you make your own Gtkwidget.
I’m not sure if this is useful for custom drawing in gtk4, but maybe the two options above are the common way.
If my understanding is wrong, please make a correction.
I’m planning to add an example of GtkDrawingArea and Cairo to my tutorial. It will take some time.
I hope you will have a great success in your project.
I agree.
Such applications are important for tutorals.
I’ve put a very simple text editor in the tutorial repository. The location is Gtk4-tutorial/src/tfe5. So, readers can try to compile and execute it if they download the whole tutorial files from the repository. And the list of the source file is in tfe5 source files.
However, it is obscure for readers to find it. I will soon add a link to the body of the tutorial and how to compile and execute the simple editor in section 14.
I’m planning to add another sample application to the tutorial. It is a simple turtle graphics interpreter. It includes custom drawing with GtkDrawingArea and Cairo. And I want to add very simple explanation about lexical analysis and parser generator.
I put the gtk4 installation instruction into the tutorial four days ago (13/Jan/2021).
See Section 2.
The tutorial is under development and unstable.
It is frequently updated recently.
So, It is good for readers to see the repository itself, not the downloaded files.
The most “necessary” thing is that you should try to incorporate them into official documents or wikis.
There are “tutorial” at the head of gtk4’s doc, and they are a lot of space to improve. Besides, anyone tries to use GTK may encounter them.
I think it’s very important to improve official documents and wikis. And maybe I could put some part of my tutorial into wikis. However, the tutorial in Gtk4 reference manual is like an introduction so it should be brief and to the point. It is not appropriate to put my whole tutorial into it.
In my experience, beginners who read the reference manual feel dificulties because of the lack of other basic concepts as GObject, GIO, Glib, Cairo and so on. Therefore, My tutorial includes them widely, not limited to gtk4. I don’t know such tutorials in the official gnome website so far. If there is a plan to make a tutorial like that in the official website, I want to make a contribution.
For now, I want to make effort to keep my tutorial corresponds to the latest gtk4 libraries.
Fortunately, I’m not so busy now and I’ll be able to do it for at least a couple of years.
I think GObject API reference is the best for you. The reference is difficult but it has detailed explanation about GObject system and it also has a good tutorial. I couldn’t understand the content at the first reading. But I thought it was crucially important and read it again and again.
If you have questions, make your new topic. Then, members can help you a lot.
I have read the reference and I agree that it is difficult to understand on the first glance. That is precisely my point however. Gtk is completely based on GLib and GObject paradigms.
The book I references is beginner focused too. It explains a lot about the basics - being GObject and GLib but it is out of date.
I think that Gtk in itsef is not that complicated at all. There is a lot of content about widget systems and the Gtk itself. However I failed to find anything up to date that would cover the GObject.