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
2
votes
1 answer

Example of programmatically creating and populating a TreeView in gi-gtk

I don't seem to be able to write working code that creates and populates a TreeView using the gtk 3 bindings of gi-gtk (specifically version 3.0.32). All examples I could find online are for different (and older) bindings that do not apply to…
fsestini
  • 121
  • 6
2
votes
2 answers

Is gschemas.compiled architecture specific (can I ship it with my python library)?

I'm working on a python library / app that uses Gtk. Part of my build process uses glib-compile-schemas to create gschemas.compiled. If I include gschemas.compiled in my library, will this break things, if somebody tries to use my library on…
Stuart Axon
  • 1,844
  • 1
  • 26
  • 44
2
votes
2 answers

How do you make a HTTP GET request with libSoup and GI?

I want to make a simple HTTP GET request to https://httpbin.org/get with the libSoup GLib library, using GObject-introspection (gi) in python. How do you do this?
Azsgy
  • 3,139
  • 2
  • 29
  • 40
2
votes
1 answer

Get GDK Window from xid, under Wayland

In a nutshell: this is a repeat of How to get Gdk window from xid?, but under Wayland. Code like the following worked fine until I updated Debian from Stretch to Buster: #!/usr/bin/env python3 from gi.repository import Gdk from gi.repository import…
GKFX
  • 1,386
  • 1
  • 11
  • 30
2
votes
1 answer

Callback not called in pygobject notification action

I'd like to add an action to my Notification with a callback. I'm using pygobject with the following code: import logging from time import sleep import gi gi.require_version('Notify', '0.7') from gi.repository import Notify def callback(*args,…
awelkie
  • 2,422
  • 1
  • 22
  • 32
2
votes
0 answers

gobject-introspection-1.48.0 fails to build

Hello I was trying to build the latest GTK+ 3.0 on Debian Jessie. After installing the required packages (lots of) I have to build gobject-introspection-1.48.0, but make command fails. ./config ran without errors. I looked for this issue and just…
Nomid
  • 91
  • 8
2
votes
0 answers

Standalone Gtk.Menu popup not working without event.time

I'm trying to port a program I made with pygtk, it's a popup menu launched via global shortcut (using keybinder) to run specific programs and commands. There is no main window in this program, the point is have a simple, fast and light "launcher"…
musicamante
  • 41,230
  • 6
  • 33
  • 58
2
votes
1 answer

Cross Compiling Python setup

I am trying to build GObject-Introspection on Ubuntu 14.04 using Mingw-w64. I am currently running 64bit Linux and trying to build for a 32bit Windows target. My first attempt used Python 2.7.8 installed in Wine, however, this did not work because…
2
votes
1 answer

How to render text on a GdkPixbuf.Pixbuf

I'm trying to add text to a Pixbuf, using Python and Gdk 3. I've been searching the web for info about this topic for hours, and it looks like I'll need to create a cairo context from the pixbuf. Unfortunately, I have zero experience with cairo, but…
Aran-Fey
  • 39,665
  • 11
  • 104
  • 149
2
votes
1 answer

How do I call vala constructors from python ? (using GObject Introspection)

I want to have a shared library written in Vala which gets called by a Python application. So i created this Vala library with two objects with one function each. The only difference is that Bar takes an argument in the constructor, whereas Foo does…
Ansgar
  • 371
  • 3
  • 15
2
votes
1 answer

how to import the gda-ui module in python?

I'm trying to get started with libgda in python (3.4). To import the Gda module i do from gi.repository import Gda I want to use GdauiTreeStore but i don't know how to import the Gda-ui module... Things like that didn't work: from gi.repository…
jkd
  • 1,327
  • 14
  • 29
2
votes
1 answer

Using gpointer with Python and GObject introspection

I am learning about Python and Gtk 3, using GObject introspection. I have done some samples, and I am begining to understant how it works. But there is one thing I can't understand, How can I pass a gpointer param? I trying to use a function who…
wof
  • 23
  • 3
1
vote
0 answers

Trigger visual update of CSS-specified property after Gtk3 widget state change

I have a widget on which I am drawing in a python-gtk3 application, and clicking on it triggers a specific action. I want to show some visual feedback on hover, to indicate the widget is interactive. After figuring out cursors are not the way in…
Cimbali
  • 11,012
  • 1
  • 39
  • 68
1
vote
1 answer

How to send a `vararg variadicArguments: kotlin.Any?` to a GObject native call with Kotlin Native?

I'm working on a GIR generator to create Kotlin Native bindings for GTK and other GObject based libraries. I reached a stage where I can almost compile the bindings for GLib but I'm stuck with the handling of varargs. For example…
1
vote
1 answer

Difficulties installing some gems (rsvg2 and gobject-introspection) on macOS 13

I'm trying to install the following gems without any luck: rsvg2 gobject-introspection Native library of gobject-introspection is installed via brew. I'm using ruby 2.7.2 installed using RVM when ever I try to install rsvg2 or gobject-introspection…
Ibrahim salem
  • 11
  • 1
  • 3