gobject

Which languages does libpeas support?

試著忘記壹切 提交于 2019-12-13 07:25:35
问题 The plugin description for a libpeas plugin contains a line determining the Loader and with this the programming language the plugin is written in. It seems the documentation includes not list of available languages. Inspecting the git repository of the project, a top-level directory "Loaders" can be found listing entries for c, gjs, seed and python. It is unclear also if the python version expected is 2 or 3. These are by far fewer languages that the related gobject introspection provides

How to override handle_message in GstBin?

风格不统一 提交于 2019-12-12 04:21:21
问题 Trying to make a subclass: mybin.h: #pragma once #include <gst/gstbin.h> G_BEGIN_DECLS G_DECLARE_DERIVABLE_TYPE(MyBin, my_bin, MY, BIN, GstBin) struct _MyBinClass { GstBinClass parent_class; }; GstElement* my_bin_new(const gchar *name); G_END_DECLS mybin.c: #include "mybin.h" G_DEFINE_TYPE(MyBin, my_bin, GST_TYPE_BIN) static void my_bin_init(MyBin *bin) { } static void my_bin_class_init(MyBinClass *class) { // virtual function overrides go here } GstElement* my_bin_new(const gchar *name) { //

pydev issue with gobject

巧了我就是萌 提交于 2019-12-11 08:54:33
问题 It seems that Pydev (1.5.4) on Eclipse (3.5.1) with Python 2.6 isn't able to correctly cross-reference the package gobject . Putting import gobject works OK but any more than that (e.g. class X(gobject.GObject) causes Pydev to report "unresolved reference" errors. What could be the problem? Note that every other package I use doesn't trigger this error. 回答1: The issue is related to this limitation of PyDev: I have a library installed and Pydev does not find it Well, problems have been

Gtk.Entry in Gtk.TreeView (CellRenderer)

江枫思渺然 提交于 2019-12-11 07:31:40
问题 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 or Gtk.CellRendererText , and override the start_editing method (or similar)? I can find examples of subclassing Gtk.CellRenderer , but not modifying the editable behaviour. I can't find the source-code for the Gtk.CellRendererText class, either. I

GObject.add_emission_hook only works once

和自甴很熟 提交于 2019-12-11 06:50:52
问题 I want to use GObject.add_emission_hook to connect to catch a signal of all instances of a class. It seems to work, but only once. In the minimal example below "signal received" is only printed once, no matter how many times one of the buttons is clicked. Why is that and how can I receive a signal on every click? Of course in my applications things are more complicated and the receiver (here the class Foo) does not know the objects emitting the signals. Therefore, connecting to the signals of

GStreamermm: creating a new element type (in plugin) by deriving from Gst::Element

僤鯓⒐⒋嵵緔 提交于 2019-12-08 00:40:37
问题 The standard method of creating a new element type in plugin is gobject-style "derivation" from GstElement type with all this gobject magic, like this. I'm writting a project in C++ which use GStreamer with some elements specialized for my purpose. I've written several plugins in the way mentioned above, but I'm not satisfied with the code, since too much of it is just to met gobject requirements. I consider using gstreamermm. Is it possible to create a new type of elements with C++-style

ImportError: No module named gi.repository

自古美人都是妖i 提交于 2019-12-07 01:46:59
问题 I'm trying to launch python script on Ubuntu 10.04: from gi.repository import Nautilus, GObject It doesn't work: Traceback (most recent call last): File "script.py", line 1, in <module> from gi.repository import Nautilus, GObject ImportError: No module named gi.repository I installed python-gobject-dev , python-gobject , python-nautilus , but it didn't help. Has anyone had this problem? 回答1: 10.04? That's pre-GNOME 3, so the preferred Python bindings were based on PyGTK, not PyGObject. You

How do I create a new signal in pygtk

时光毁灭记忆、已成空白 提交于 2019-12-04 11:28:17
问题 I've created a python object, but I want to send signals on it. I made it inherit from gobject.GObject, but there doesn't seem to be any way to create a new signal on my object. 回答1: You can also define signals inside the class definition: class MyGObjectClass(gobject.GObject): __gsignals__ = { "some-signal": (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE, (object, )), } The contents of the tuple are the the same as the three last arguments to gobject.signal_new . 回答2: Here is how: import

GTK+ 3.0: How to use a Gtk.TreeStore with custom model items?

♀尐吖头ヾ 提交于 2019-12-03 13:34:22
问题 I'm trying to develop a GTK application in Python and I'm really stuck with the correct usage of a gtk.TreeStore. My main problem: I've already parsed some JSON and I have my own data structure which ist basically a Python list and two kinds of objects: One represents a collection of items (collections can't be nested) and one for representing items (which might appear in the list as well as in a collection). I'm already familiar with the basic usage of a TreeStore and managed to get items

PyGObject GTK+ 3 - Documentation?

怎甘沉沦 提交于 2019-12-03 02:01:56
问题 PyGObject appears to have no real documentation. This tutorial is as close as it gets. I've been struggling all morning simply trying to find a description of the arguments accepted by the Gtk.Window constructor. It seems I can't do much reflection in Python because everything in PyGObject is dynamically generated. All I want is to know what arguments I can pass to this constructor! There doesn't appear to be an equivalent of this object in the GTK+ 3 documentation, and reading the source