Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Welcome to Software Development on Codidact!

Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.

Comments on Using DBUS and GTK in one perl program

Post

Using DBUS and GTK in one perl program

+5
−0

Perl is by far the language I have the most experience with, and I have (big) parts of the functionality I want in the new program in existing programs. So I'm looking for a way to do this in perl, but I know other languages so a good guide to do what I want in another language might be usable.

Both the DBUS and GTK tutorials I have found say to "end" (there's some cleanup to do afterwards, but that's quite irrelevant) your program with calling their main loop, for DBUS:

my $reactor=Net::DBus::Reactor->main();
# Now start the reactor loop. This will keep this program alive until it is
# killed by a signal.
$reactor->run();

and for GTK:

# Creating and run the Gtk3::Application
my $app = Gtk3::Application->new('app.id', 'flags-none');
...
$app->run(\@ARGV);

But what to do if I want to do both in one program?

  • Is there an obvious way to do it?
  • Do better (more recent?) tutorials exist?
  • In searching for how to do this I came across something called GDLIB, is that the solution, and do any good tutorial on using that exist?
History
Why does this post require moderator attention?
You might want to add some details to your flag.
Why should this post be closed?

1 comment thread

Gio (1 comment)
Gio
__blackjack__‭ wrote 11 months ago

I would just use Gio, then there is just the Glib mainloop.