Reputation: 1512
I am running through the excellent PyGtk tutorial and tracking it in what I thought was the most up-to-date PyGtk API reference. The tutorial has a topic on the Switch widget but there seems to be no corresponding entry in the PyGtk reference. (There is an entry in the C-language GTK reference, but I was hoping to stay in Python land.)
This makes me wonder if I am somehow missing a more recent PyGtk API reference? The versions are a potential source of confusion, but it seems as if PyGtk is at version 2.x, the underlying Gtk is at 3.x and the tutorial uses Python v3.
Any thoughts on where I should look for PyGtk API documentation for the Switch widget?
Thanks in advance.
Upvotes: 0
Views: 263
Reputation: 2067
As Answered by AndreLDM the api refrence is here lazka.github.io/pgi-docs/#Gtk-3.0/classes/
For more info than covered in above link see the gnome developer manual for gtk+ in C - https://developer.gnome.org/gtk3/stable/
Gtk+ is made in C so see (C!) the gnome developer manual above explaining the C functions. Also see the source code from gnome git - https://git.gnome.org//browse/
So first see the C documentation, code and then see the api documentation for pygobject (or your preferred language GbObject binding - c++, vala, haskell.gi and others)
P.S - Gnome is an umbrella project to build awesome gnome desktop. The Gnome Project contains libraries like the gtk+ toolkit to make widgets on desktop. Gtk was first written to make the gimp image editing tool which is awesome too.
Upvotes: 0
Reputation: 11454
PyGTK is for GTK+2. PyGObject is what you need for GTK+3.
Read GObject Gtk, Gnome, Gtk+, Gl, Gtk2, Gtk3...I don't understand? to understand those differences.
For GtkSwitch, the official GtkSwitch documentation clearly states it's available since GTK+3.0.
Upvotes: 0
Reputation: 4104
GtkSwitch appeared on Gtk+ 3.0 so probably you won't be able to use it from PyGtk (which uses Gtk+ 2.0), for Gtk+ 3.0 you should use PyGObject:
PyGObject is a Python module that enables developers to access GObject-based libraries such as GTK+ within Python. It exclusively supports GTK+ version 3 or later. If you want to use GTK+ 2 in your application, use PyGTK, instead.
Upvotes: 1