196 questions
Best practices
0
votes
7
replies
113
views
Command line help message with the glib GApplication API
The glib library has a build in system for parsing command line arguments and also for printing a neat help message then "--help" is given.
I think it's good practice to also show this help ...
2
votes
1
answer
57
views
gdbus-codegen serverside property changed subscription
I'm using gdbus-codegen to generate server-side code for exposing properties on a D-Bus interface. The generated code seems to maintain its own internal cache of property values. My confusion is about ...
0
votes
1
answer
79
views
gio - output differs for terminal (CLI) and execv() in C(++)
In regard to GLib/gio - g_volume_get_connected_drives returns NULL
On my Ubuntu 22.04, when running the command
/usr/bin/gio mount -l
I receive such similar output:
Drive(0): *HARDDRIVE*
Type: ...
0
votes
1
answer
79
views
GLib/gio - g_volume_get_connected_drives returns NULL
On my freshly installed Ubuntu 22.04 I tried to tinker a little with the GIO system for a project I want to start.
Just for starters I tried:
int main(){
GVolumeMonitor* monitor = ...
0
votes
1
answer
106
views
Gio.Settings behaviour changing with environment
I have a CMake project where I want to execute a Python script as part of the install target to automatically set a global keyboard shortcut for the target that gets installed.
The script itself works ...
1
vote
1
answer
90
views
How can I open a file such that I can both read from it and write into it with Gio/GLib in C?
I'm writing a program where I want to rewrite an existing configuration file. I am writing the parser for this format myself, so I can't re-use an existing parser. I want to use GLib/Gio's utility ...
2
votes
1
answer
157
views
How do I actually provide a GType for the first argument of the GListStore constructor in C?
I need to use a GListStore for a specific GTK API in a C program, and as such I'm trying to create one so I can fill it with some elements. Looking at the documentation for g_list_store_new (), I need ...
0
votes
1
answer
47
views
How to create a wrapper over gio.OutputStream to send a chunked transfer encoding stream on Rust
I want to create a chunked transfer encoding class that inheritance from OutputStream and delegates to another OutputStream, something as follows: ChunkedOutputStream(inner = OutputStream) , where ...
0
votes
1
answer
63
views
using gio move in a script executed in a cron job in Ubuntu
I have a program which starts a bash shell script that uses "gio move". When the program is run from the command line everything works fine. When the program is started from a cron job it ...
1
vote
1
answer
120
views
Using GCancellable with the GtkAlertDialog
For testing purposes, I wrote a small program calling a GtkAlertDialog and showing the results of the user selection.
I noticed the topic of GCancellable.
Despite studying the documentation, I did not ...
1
vote
2
answers
122
views
File not found when using g_resource_lookup_data()
I am attempting to access a file that has been compiled into a GResouce using gnome.compile_resources() in meson. I successfully get the generated source files and #include "shader-resources.h&...
0
votes
1
answer
145
views
How do I check if a listed Gio schema is good? GLib-GIO-ERROR attempting to create schema ... without a path
I would like to list the schemas for the purpose of making a setting search tool.
However, some schemas make Gio.Settings.new cause a core dump.
This script requires linux and the "python3-gi&...
1
vote
0
answers
94
views
What is the best way to wait GIO objects updated in GTK application?
I wait socket updation with IOChannel of GLib because g_io_add_watch function of IOChannel adds the GIOChannel into the default main loop context. This is so nice I do not need to make an additional ...
1
vote
0
answers
70
views
Go GIO widget mouse events not working with pointer receiver
go version
go version go1.20.2 darwin/arm64
I'm following an example here in order to learn Widgets in Go. For the interactive portion, I first made the mistake of not using a pointer receiver for ...
1
vote
1
answer
150
views
How do I receive UDP broadcast packets using GTK / GIO?
I have a custom product (running Linux) spitting out broadcast packets every few seconds to port 38280.
Here's a screen capture of Wireshark showing the packets in question.
Under a Linux VM (Ubuntu ...