Questions tagged [gobject-introspection]

GObject introspection is a middleware layer between C GObject libraries and language bindings. The C library is scanned at compile time to generate a metadata file. At runtime, language bindings can read this metadata and automatically provide bindings to call into the native C library.

GObject introspection is a middleware layer between C libraries (which must use ) and language bindings. The C library can be scanned at compile time and generate a metadata file, in addition to the actual native C library. Then at runtime, language bindings can read this metadata and automatically provide bindings to call into the C library.

Two-level applications: C and your favorite runtime.

It makes sense to build many kinds of applications using (at least) two different levels and languages. Those being C + GObject, and a managed () runtime. C is good for graphics, multimedia, and lower level systems. However, writing complex software is difficult and error-prone without garbage collection. A managed runtime such as Vala, JavaScript, Python, Java, Lua, .NET, Scheme etc. makes a lot of sense for non-fast-path application logic such as configuration, layout and dialogs.

Thus, one of the major goals of the GObject introspection project is to be a convenient bridge between these two worlds, and allow you to choose the right tool for the job, rather than being limited inside one or the other. With the introspection project, you can write for example a ClutterActor or GtkWidget subclass in C, and then without any additional work use that class in JavaScript.

95 questions
1
vote
3 answers

GdkPixbuf returns "gi._glib.GError: Couldn't recognize the image file format"

I have a problem loading PNG images in Gtk3. I have broken image symbols in my ToolButtons and after some investigation it appears that it comes from GdkPixbuf not being able to read the PNG files. I have reproduced the problem with the python…
1
vote
1 answer

update unmantained software using pygtk

I am trying to get an old piece of software back to work. it is a standalone database client, its graphical interface is described with python-glade and used/used the python module gtk. when I last used it, it was two or three years ago, and at…
mariotomo
  • 9,438
  • 8
  • 47
  • 66
1
vote
1 answer

Difference between python pygir-ctypes and gi.repository

I don't understand the difference and requirements of 2 python gtk3 packages. one is the activestate pygir-ctypes package installed by pypm and the other one is the standard linux (I use Ubuntu) python gobject-introspection. The documentation on…
Web
  • 13
  • 1
  • 2
1
vote
2 answers

What is the python equivalent of g_log_set_handler when using GLib from python

I want to set the log level in my python glib project. Therefore I am looking for the g_log_set_handler() equivalent when using GLib from python via gi.repository. But the expected GLib.log_set_handler function seems to be missing. Here is a sample…
Dynalon
  • 6,577
  • 10
  • 54
  • 84
1
vote
2 answers

GObject Introspection across multiple languages

The Wiki page of the old PyGTK 2.8 binding states that an object properly written in Python should also be easily usable from C code, or even other language bindings. But PyGTK is outdated and should be replaced by PyGObject. Is it possible to mix…
XZS
  • 2,374
  • 2
  • 19
  • 38
1
vote
1 answer

creating an object from a ctype.c_void_pointer

I am doing the following in python import ctypes, ctypes.util from gi.repository import WebKit, JSCore, GLib, Gtk import sys webkit = ctypes.CDLL(ctypes.util.find_library('webkitgtk-3.0')) jscore =…
smor
  • 161
  • 1
  • 8
1
vote
1 answer

Should I use Nautilus GIR and if so, where is the documentation?

I'm writing a Python3/GObject based application which will use a number of file browser-like widgets. Is the best move to write these from scratch or to use GObject Introspection with Nautilus, and if so where can I find or how can I generate the…
1
vote
3 answers

Using C++ bindings with GObject Introspection

I decided I want to use the Goffice library in my project. But I write it in C++, so I prefer to have a C++ class interface, just like I use gtkmm and not GTK+ directly. The documentation (see link above) says I can use GObject Introspection. So I…
1
vote
1 answer

Storing custom information in a widget, gobject-introspect

Is there a way to store custom information with a widget? For instance, say I have a list with 20 urls. I create 20 buttons, one for each url. I want to make it so when I click a button, a url opens. But i need a way to know which button is linked…
sqram
  • 7,069
  • 8
  • 48
  • 66
0
votes
1 answer

udev interface for python3?

Is there any example on how to capture udev events in Python3? I can't get events working at all in .237 (or 1.0?). And couldn't get any examples of GUdev with Introspection. I'm not sure where the problem lies. I found an example test.py but there,…
jcoppens
  • 5,306
  • 6
  • 27
  • 47
0
votes
1 answer

Virtual function in an abstract type returning GObject pointer is not introspectible

I'm playing around with libpeas and I stumbled upon a problem with the way gobject-introspection works. In libpeas there is a type called PluginLoader (see here). There is a method called create_extension that returns PeasExtension * which is a…
senya
  • 984
  • 12
  • 20
0
votes
1 answer

Will PyGObject let me use a Python array.array to pass a GArray of floats to a library (Gimp)?

Some Gimp methods exposed via GI (GObject introspection) expect a GValue whose value is a GArray of float. In Python, can I create an array.array of float and expect PyGObject to marshal it correctly to a GArray? (loosely speaking, to a pointer to…
bootchk
  • 1,926
  • 17
  • 14
0
votes
1 answer

GTK Label width-chars and halign

I've got a Gtk.Label contained within a Gtk.Grid something like as follows: self.__grid = Gtk.Grid() self.__grid.set_row_spacing(2) self.__grid.set_column_spacing(5) self.__grid.props.margin = 5 #... self.clock_label =…
pdm
  • 1,027
  • 1
  • 9
  • 24
0
votes
1 answer

How can I set a custom page size in a GtkPrintOperation?

I am using a GtkPrintOperation and need a custom page size for the draw-page signal. Here is a Print Operation using python: import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk print_op = Gtk.PrintOperation…
theGtknerd
  • 3,647
  • 1
  • 13
  • 34
0
votes
0 answers

Configure error for gobject-introspection Python libs not found

I am building gobject-introspection-1.56.1. getting this configure error, headers are found, but libraries are not found, what libraries? I have already included all LIBS and LDFLAGS from pkg-config checking for python extension module directory...…
topcat
  • 177
  • 3
  • 17