pygobject

How can I get the default colors in GTK?

筅森魡賤 提交于 2021-02-18 10:14:57
问题 Context In GTK 3, people can set their own themes. Even the default theme (Adwaita) is provided with two variants: a light one and a dark one. As I am writing my own widget (in python), I need to get these colors in order to avoid drawing black on black or white on white. Question How can I access the default colors of the user GTK theme? Things that don't work GtkSettings used to provide an acceptable gtk-theme-color property, but it is not there anymore and there is no reference in the doc

How can I get the default colors in GTK?

烂漫一生 提交于 2021-02-18 10:14:16
问题 Context In GTK 3, people can set their own themes. Even the default theme (Adwaita) is provided with two variants: a light one and a dark one. As I am writing my own widget (in python), I need to get these colors in order to avoid drawing black on black or white on white. Question How can I access the default colors of the user GTK theme? Things that don't work GtkSettings used to provide an acceptable gtk-theme-color property, but it is not there anymore and there is no reference in the doc

How can I get the default colors in GTK?

馋奶兔 提交于 2021-02-18 10:13:15
问题 Context In GTK 3, people can set their own themes. Even the default theme (Adwaita) is provided with two variants: a light one and a dark one. As I am writing my own widget (in python), I need to get these colors in order to avoid drawing black on black or white on white. Question How can I access the default colors of the user GTK theme? Things that don't work GtkSettings used to provide an acceptable gtk-theme-color property, but it is not there anymore and there is no reference in the doc

Writing MATE/GNOME Applets (Python) with PyGObject Introspection

与世无争的帅哥 提交于 2021-02-08 14:39:52
问题 So I have been trying to port a C GNOME applet to MATE, and after running into many different problems, I decided to rewrite it from scratch in python. Eventually, I found some not-horribly-out-of-date documentation, which is here: http://wiki.mate-desktop.org/docs:devel:mate-panel Apparently the new way of writing applets in python is to use PyGObject introspection, instead of the 'old' PyGtk. So I have a few questions: 1. Why is it better to use PyGObject instead of PyGtk etc 2. Is the end

How I can create a python class that takes it definition from Gtk builder

冷暖自知 提交于 2021-02-08 08:12:20
问题 I have made my whole GUI definition over glade, I'm using PyGObject with python 2.7. I have made some widgets that have ids and I can retrieve those objects by calling the corresponding id, for now I have been doing something like this: class MLPNotebookTab: def __init__(self): builder = Gtk.Builder.new_from_file(UI_FILE) builder.connect_signals(self) self.notebook = builder.get_object('MLPNotebook') def add_tab(self, content): pages = self.notebook.get_n_pages() label = "MLP #" + str(pages +

How I can create a python class that takes it definition from Gtk builder

ぃ、小莉子 提交于 2021-02-08 08:11:44
问题 I have made my whole GUI definition over glade, I'm using PyGObject with python 2.7. I have made some widgets that have ids and I can retrieve those objects by calling the corresponding id, for now I have been doing something like this: class MLPNotebookTab: def __init__(self): builder = Gtk.Builder.new_from_file(UI_FILE) builder.connect_signals(self) self.notebook = builder.get_object('MLPNotebook') def add_tab(self, content): pages = self.notebook.get_n_pages() label = "MLP #" + str(pages +

How do I install PyGObject?

耗尽温柔 提交于 2021-02-07 09:48:32
问题 I am trying to install PyGtk on windows 7 for Python 2.7, but when go to use pip to install PyGtk it says i need PyGObject (Go figure) so I installed the Visual C++ package for Python (I know I have the correct version) and tried using pip to install PyGObject but it keeps comming out with an error message saying that cairo.h is missing, and sure enough I check in the directory and it wasn't there. How on earth am I supposed to install PyGObject? 回答1: There's a quite long way, and it needs

How do I install PyGObject?

无人久伴 提交于 2021-02-07 09:47:14
问题 I am trying to install PyGtk on windows 7 for Python 2.7, but when go to use pip to install PyGtk it says i need PyGObject (Go figure) so I installed the Visual C++ package for Python (I know I have the correct version) and tried using pip to install PyGObject but it keeps comming out with an error message saying that cairo.h is missing, and sure enough I check in the directory and it wasn't there. How on earth am I supposed to install PyGObject? 回答1: There's a quite long way, and it needs

How do I install PyGObject?

微笑、不失礼 提交于 2021-02-07 09:45:40
问题 I am trying to install PyGtk on windows 7 for Python 2.7, but when go to use pip to install PyGtk it says i need PyGObject (Go figure) so I installed the Visual C++ package for Python (I know I have the correct version) and tried using pip to install PyGObject but it keeps comming out with an error message saying that cairo.h is missing, and sure enough I check in the directory and it wasn't there. How on earth am I supposed to install PyGObject? 回答1: There's a quite long way, and it needs

Handling errors with gst-rtsp-server Python bindings

ⅰ亾dé卋堺 提交于 2021-01-29 11:30:41
问题 I have a simple Python program creates an RTSP stream using gst-rtsp-server. It works, but as-is there's no error handling. If the pipeline has a typo or there's some issue connecting to the video source, I don't see a stack trace or any logging. Where would I hook in code to handle problems like this? I should mention that I'm a complete beginner to the GObject world. I suspect there is a standard way for these libraries to report errors but I haven't been able to find anything in the