Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python and Gtk - which GTK version is being used?

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!

like image 933
David Gomes Avatar asked Jun 19 '12 09:06

David Gomes


People also ask

Can I use GTK with python?

GTK and Python It supports Linux, Windows and macOS and works with Python 2.7+, Python 3.5+, PyPy and PyPy3.

What is PyGObject used for?

PyGObject provides a wrapper for use in Python programs when accessing GObject libraries. GObject is an object system used by GTK, GLib, GObject, GIO, GStreamer and other libraries.


1 Answers

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

Gtk.get_major_version()
Gtk.get_minor_version()
Gtk.get_micro_version()
like image 173
Szilárd Pfeiffer Avatar answered Sep 21 '22 22:09

Szilárd Pfeiffer