GTK 4 tutorial for beginners
Find a file
2021-06-18 22:35:20 +09:00
gfm Modify section 12 and 13. 2021-06-18 22:35:20 +09:00
image Modify section 12 and 13. 2021-06-18 22:35:20 +09:00
lib Bug fixed in list1.c, lib_src2md.rb. 2021-05-14 21:34:11 +09:00
src Modify section 12 and 13. 2021-06-18 22:35:20 +09:00
test Modify Rakefile and lib_src2md.rb. Rename and modify lib_sec_file.rb to lib_src_file.rb. Change the directory structure. 2021-04-27 21:08:30 +09:00
.gitignore Bug fixed. 2021-04-19 23:37:36 +09:00
Rakefile Bug fixed in list1.c, lib_src2md.rb. 2021-05-14 21:34:11 +09:00
Readme.md Modify section 12 and 13. 2021-06-18 22:35:20 +09:00
src2md.rb Add document about Gfile related objects. 2021-03-12 14:45:24 +09:00

Gtk4 Tutorial for beginners

This tutorial illustrates how to write C programs with Gtk4 library. It focuses on beginners so the contents are limited to basic things. The table of contents are shown at the end of this abstract.

  • Section 3 to 20 describes basics and the example is a simple editor tfe (Text File Editor).
  • Section 21 to 23 describes GtkDrawingArea.
  • Section 24 to 27 describes list model and list view (GtkListView, GtkGridView and GtkColumnView). It also describes GtkExpression.

Please refer to Gtk API reference and Gnome Developer Center for further topics.

This tutorial is under development and unstable. Even though the codes of the examples have been tested on gtk4 version 4.0, there might exist bugs. If you find any bugs, errors or mistakes in the tutorial and C examples, please let me know. You can post it to github issues. The latest version of the tutorial is located at Gtk4-tutorial github repository. You can read it without download.

If you want to get a html or pdf version, you can make them with rake, which is a ruby version of make. There is a documentation "[How to build Gtk4 Tutorial](gfm/Readme_for_developers.md)" that describes how to make them.

If you have a question, feel free to post it to the issue. Any question is helpful to make this tutorial get better.

Table of contents

  1. Prerequisite and License
  2. Installation of Gtk4 to Linux distributions
  3. GtkApplication and GtkApplicationWindow
  4. Widgets (1)
  5. Widgets (2)
  6. String and memory management
  7. Widgets (3)
  8. Define Child object
  9. Ui file and GtkBuilder
  10. Build system
  11. Initialization and destruction of instances
  12. Signals
  13. Functions in TfeTextView
  14. Functions in GtkNotebook
  15. tfeapplication.c
  16. tfe5 source files
  17. Menu and action
  18. Stateful action
  19. Ui file for menu and action entries
  20. GtkMenuButton, accelerators, font, pango and gsettings
  21. Template XML
  22. GtkDrawingArea and Cairo
  23. Combine GtkDrawingArea and TfeTextView
  24. Tiny turtle graphics interpreter
  25. GtkListView
  26. GtkGridView and activate signal
  27. GtkExpression
  28. GtkColumnView