Questions tagged [gobject]

GObject(GLib Object System) provides a portable object system and transparent cross-language interoperability.

336 questions
3
votes
1 answer

How to create a gsignal without parameters in pygtk

The pygtk signal documentation is pretty clear about signals creation, but I could not create a signal that doesn't take parameters. What I want is to define (like in the example): class MyGObjectClass(gobject.GObject): __gsignals__ = { …
alexef
  • 442
  • 2
  • 13
3
votes
1 answer

Using gobject.timeout_add_seconds - Segmentation Fault

I am writing a gui program that allows a user to repeatedly send a message to a phone number with a configurable delay and number of repetitions. I used QT Designer to create a gui, and now I am trying to create the code behind it. I am trying to…
xur17
  • 506
  • 1
  • 8
  • 24
3
votes
1 answer

python mainloop, add timed events

I have a Python script that does stuff based on D-Bus events, simplified version of that: import dbus from dbus.mainloop.glib import DBusGMainLoop import gobject DBusGMainLoop(set_as_default=True) bus = dbus.SystemBus() # Initialize a main…
svenema
  • 1,766
  • 2
  • 23
  • 45
3
votes
1 answer

Python, GTK3, How can I change view of disabled widget to normal view from disabled view?

after I change widget state to disabled. view of widget is changing to disabled view. I don't want to change view of widget only change state of widget. How can I ensure this ? thanks. btn = Gtk.Button("example") btn.set_sensitive(False) # this code…
Nomad
  • 918
  • 6
  • 23
3
votes
1 answer

What is the correct way in GJS to define a GObject property for an Array?

I see in the GJS GObject overrides there are definitions for most types that correspond to Javascript types, but how should I define a property for a standard Array of strings? Some options that have occurred to me: use TYPE_OBJECT and a GList, but…
andy.holmes
  • 3,383
  • 17
  • 28
3
votes
2 answers

How are "out parameters" represented for Seed JavaScript GObject bindings?

I've just started using Seed for development. One thing that Seed's web page mentions is that it "Maps C-isms (say, out arguments, or enums) to things that make sense in JavaScript." Unfortunately, I can't find any documentation or examples for how…
jbeard4
  • 12,664
  • 4
  • 57
  • 67
3
votes
1 answer

Please change all occurrences of "import gobject" to "from gi.repository import GObject"

I try to improt Gtk like this: from gi.repository import Gtk and I get the following error: ImportError: When using gi.repository you must not import static modules like "gobject". Please change all occurrences of "import gobject" to "from…
max5555
  • 495
  • 5
  • 9
3
votes
2 answers

How to access GParamSpec-related functions from Python GObject Instrospection?

I am wondering whether GObject Introspection is currently broken (with Python at least)... 1. Short code example Let's try this piece of code to obtain a GParamSpec struct: # Various imports import gi gi.require_version('Gst', '1.0') from…
JohnW
  • 505
  • 3
  • 14
3
votes
1 answer

GObject OOP Syntax

I'm looking for a GObject cheat sheet, how common OOP concepts map to GObject's facilities. Consider for example: AnyGObject *o; o = anygobject_new(); Now, what are the conventions for... calling a method calling a method declared by a base…
edgar.holleis
  • 4,803
  • 2
  • 23
  • 27
3
votes
1 answer

Get the class structure instance of a GObject type

How do I get a class object of a certain class in GObject / Gtk? For example, if my class is GtkSpinButton, I want to get the instance of GtkSpinButtonClass that represents the class. It is the parameter "class" in gtk_spin_button_class_init…
jdm
  • 9,470
  • 12
  • 58
  • 110
3
votes
1 answer

How to shut down gobject main loop properly in python?

I find myself confronted with a gobject for the first time while trying to listening to dbus. I found this piece of code teaching me how to set up a main loop. How can I listen for 'usb device inserted' events in Linux, in Python? But what I need…
JasonTS
  • 2,479
  • 4
  • 32
  • 48
3
votes
3 answers

gobject io monitoring + nonblocking reads

I've got a problem with using the io_add_watch monitor in python (via gobject). I want to do a nonblocking read of the whole buffer after every notification. Here's the code (shortened a bit): class SomeApp(object): def __init__(self): #…
viraptor
  • 33,322
  • 10
  • 107
  • 191
3
votes
1 answer

Very simple python-dbus server/client in same process

I'm playing with DBus and python. I have created a very simple DBus client and corresponding server. It works perfectly when each runs on its own python process. However, I'm trying to get it to work in the same process, but it only works 10% of the…
STenyaK
  • 1,047
  • 1
  • 8
  • 15
3
votes
0 answers

Python - Blocked thread at os.listdir

I have a mainloop in my program's main thread (The mainloop is a DBusGMainLoop waiting for a disk I/O event), every time an event handler is called a new thread is dispensed for some file copying. The strange thing happens at this point. Suppose an…
Auxiliary
  • 2,687
  • 5
  • 37
  • 59
3
votes
2 answers

Gtk.Entry in Gtk.TreeView (CellRenderer)

I want to pack a Gtk.Entry (with Gtk.EntryCompletion hooked up) into a cell in a Gtk.TreeView. Does anyone know how this can be done? (I just need entry completion on a text entry in a tabular view.) Do I perhaps need to subclass Gtk.CellRenderer…
simon
  • 15,344
  • 5
  • 45
  • 67