Questions tagged [lgi]

LGI is gobject-introspection based dynamic Lua binding to GObject based libraries. It allows using GObject-based libraries directly from Lua, most notably GTK+.

Project homepage: https://github.com/pavouk/lgi

8 questions
3
votes
4 answers

Is there a way to check if a GTK widget supports a property without checking version numbers?

According to the GTK API reference, the "license-type" property of GtkAboutDialog is only present in GTK >= 3.0. For compatibility, my code currently checks the GTK version before setting the "license-type" property: -- This is Lua code binding to…
hugomg
  • 68,213
  • 24
  • 160
  • 246
1
vote
2 answers

How to fix timezone/dst in lua's lgi?

Situation It appears to me that my timezone is configured correctly because with [nix-shell:~]$ date +"%T %Z" 19:49:07 CET I get what I expect. But with lua's lgi library I am appearently using Daylight Saving Time,whereas the normal lua functions…
Lucas
  • 685
  • 4
  • 19
1
vote
1 answer

Lua: translate a Python code that emits a message using a XML dbus definition into Lua

I asked this in a comment of a previous question but I think it is better to move it here as a new independent question. I am trying to figure out how to translate this Python code to emit a dbus signal into Lua using lgi DBus: class…
jap jap
  • 320
  • 2
  • 15
1
vote
1 answer

lua lgi subscribe to DBus signal

I am using LUA for the first time and I am trying to subscribe a callback to be executed when a DBus signal is received. I found some examples about how to send DBus signals using lgi but I haven't found anything about how to listen to a signal. Is…
jap jap
  • 320
  • 2
  • 15
1
vote
2 answers

Lua LGI unpack GLib.Variant object

I'm trying to get password from keyring for awesome-wm session (using DBus via lgi library). I'm able to find keyring entry path, open communication session and unlock entry. Then I call GetSecrets method and store result into secret…
Sergey
  • 1,166
  • 14
  • 27
0
votes
1 answer

How to draw_area with cairo

i am trying to 'update' lgi (lua gtk binding) examples, which are for gtk3 purpose is to draw geocentric view of solar system, in 2d, for start app has top row for input, below are 2 x 2 panned widget group - 1 x vertical layout, inside are 2 x…
aum hren
  • 13
  • 6
0
votes
0 answers

Segfault when using `lgi.Pango.AttrList.change` in AwesomeWM

Some context: I am writing a font-previewing application, and one of the things I have to do very often is change the size of the text. As you can see in the image, someone drags the "Size" slider, and the application has to change the size of all…
0
votes
1 answer

How do I convert a symbolic GtkIconSize to an integer size in pixels?

I'm updating a GTK+ program, trying to replace all instances of the "stock icons" using "stock ids" to icons using the "icon-name" property. One place that I am a bit confused is how to get the size of an icon. I have some code that uses the…
hugomg
  • 68,213
  • 24
  • 160
  • 246