Question: ```
from gi.repository import Gtk

#print Gtk.GTK_MAJOR_VERSION

win = Gtk.Window()
win.connect("delete-event", Gtk.main_quit)
win.show_all()
Gtk.main()

```

That is my code, how can I know which version of Gtk is being used.

Thank you!

Answer: 
You can use the following functions to get the version information:

```
Gtk.get_major_version()
Gtk.get_minor_version()
Gtk.get_micro_version()

```
For check in .gir files:

```
grep -rin 'get_[a-zA-Z]*_version' /usr/share/gir-1.0/Gtk-3.0.gir

```

Example output:

```
grep -rin 'get_[a-zA-Z]*_version' /usr/share/gir-1.0/Gtk-3.0.gir
108409:    <function name="get_major_version"
108410:              c:identifier="gtk_get_major_version"
108424:    <function name="get_micro_version"
108425:              c:identifier="gtk_get_micro_version"
108439:    <function name="get_minor_version"
108440:              c:identifier="gtk_get_minor_version"

```