Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8187133
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T02:27:43+00:00 2026-06-07T02:27:43+00:00

I have been looking into the source code of python-mpdor and it mentions that

  • 0

I have been looking into the source code of python-mpdor and it mentions that it is

gobject-based, for easy event handling (in the high-level client
class).

Can someone explain to me in simple terms what exactly are Glib and GObject and how do they interact with each other and what role it plays in event handling.

I tried searching for Glib and GObject but I didn’t found any basic explanation for it. All the explanations I found are very technical and by technical I mean not suitable for a beginner.

Also, can someone point to some beginner tutorials/articles about Glib and GObject.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T02:27:45+00:00Added an answer on June 7, 2026 at 2:27 am

    GLib and GOBject are 2 separate C libraries from which the GTK+ GUI toolkit is built (among other things).

    Since C is a lower-level language, GLib provides a lot of basic functionality like those utilities similar to what is built-in with Python (file input/output, string manipulation, memory management, threading, etc.).

    Since C is not an object-oriented language, GObject provides a C-based object system which includes properties and inheritance (again, built into Python already). In Python, you rarely use GLib directly (because Python has most of that functionality built-in) but GObject is dependent upon GLib.

    All GObject-based libraries are designed to support language bindings to other languages such as Python.

    To the point of your question, GObject provides an event system known as “signals”. Any object derived from GObject can “emit” signals to send notifications of an event occurring. The MPDProtocolClient class in python-mpdor is derived from GObject and thus it can emit signals. Applications “connect” functions to these signals. F

    For example, the README shows this example:

    import gobject
    import mpdor
    
    def notify(client, vol):
        print "mpd volume is at ", vol + "%"
    
    client = mpdor.client.Client()
    client.connect("mixer-change", notify)
    gobject.MainLoop().run()
    

    In this case, the function named notify is “connected” to the "mixer-change" signal which means that function will be called any time the client “emits” that signal. The gobject.MainLoop().run() call enters a “main event loop” (basically an infinite loop) which is a standard concept in event-driven programming.

    You probably won’t find a lot of GObject/Python tutorials, however, if you learn a little bit of Python/GTK+ basics then you’ll likely get a grasp of the concepts of the event loop, signals, and signal callbacks. (It looks like python-mpdor is using GTK+ 2 which would be PyGTK as opposed to newer GTK+ 3 which is PyGObject).

    Good luck.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been looking into coloring objects like ellipses with code such as SolidBrush
I have been looking into packages that would enable me to have tabs in
I have been looking into integrating testing into my app based on RequireJS. I
I have been looking into AWS spot instances for some jobs however instead of
I have been looking into backbone.js and I can't seem to figure out how
I have been looking into CruiseControl configuration recently (I'm a complete CC noob) and
I have been looking into different systems for creating a fast cache in a
I have been looking into MVVM design patterns with WPF for a project. I
I have been looking into HTML5 manifest but I am unclear as to whether
I have been looking into Spring Social Facebook's publish(objectId, connectionName, data) API , but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.