gtk

Force background of matplotlib figure to be transparent

偶尔善良 提交于 2021-02-07 14:43:19
问题 I'm trying to include a matplotlib figure in a Python Gtk3 application I'm writing. I'd like to set the background colour of the figure to be transparent, so that the figure just shows up against the natural grey background of the application, but nothing I've tried so far seems to be working. Here's an MWE: from gi.repository import Gtk import matplotlib.pyplot as plt import matplotlib.lines as mlines import numpy as np from matplotlib.backends.backend_gtk3agg import FigureCanvasGTK3Agg as

select certain monitor for going fullscreen with gtk

时光怂恿深爱的人放手 提交于 2021-02-07 14:42:54
问题 I intend to change the monitor where I show a fullscreen window. This is especially interesting when having a projector hooked up. I've tried to use fullscreen_on_monitor but that doesn't produce any visible changes. Here is a non-working example: #!/usr/bin/env python import sys import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk from gi.repository import Gdk w = Gtk.Window() screen = Gdk.Screen.get_default() print ("Montors: %d" % screen.get_n_monitors()) if len(sys

python GTK3 limit label width

﹥>﹥吖頭↗ 提交于 2021-02-07 11:46:14
问题 I've got a set of labels in a flowbox, the problem is that I would like for these labels to be 96px wide at most. I've set label.set_ellipsize(True), but since the flowbox gives them as much room as they like they don't get ellipsized, even though I've set their size request to 96px wide. I've tried every function I could find that seemed even tangentially related on all the widgets involved, but nothing seems to work. the only workaround I did find was using set_min_children_per_line() but

gcc raises “unrecognized command line option” error with pkg-config

▼魔方 西西 提交于 2021-02-07 10:24:43
问题 I am trying to compile a gtk program using the tutorial here. When I issue the command gcc -o tut tut.c $(pkg-config --cflags --libs gtk+-2.0 gmodule-2.0) I get the following error: gcc: error: unrecognized command line option ‘-pthread -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib/x86

gcc raises “unrecognized command line option” error with pkg-config

冷暖自知 提交于 2021-02-07 10:24:25
问题 I am trying to compile a gtk program using the tutorial here. When I issue the command gcc -o tut tut.c $(pkg-config --cflags --libs gtk+-2.0 gmodule-2.0) I get the following error: gcc: error: unrecognized command line option ‘-pthread -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib/x86

Equivalent of Password Char in GTK#

你离开我真会死。 提交于 2021-02-05 11:32:38
问题 I am in the middle of porting a WinForms app to GTK#. In the WinForms version, I have a textbox with a password char of "*", but unfortunately, I can not seem to replicate this in GTK#. Any help would be greatly appreciated. Thanks, Chris 回答1: For whoever is still looking for this answer, here it is. For any given entry, if you turn the member "visibility" to "false" you will get hidden characters such as: So foo.Visibility = false; 来源: https://stackoverflow.com/questions/11696311/equivalent

How do I initialize a GActionMap variable?

﹥>﹥吖頭↗ 提交于 2021-02-05 07:35:22
问题 I want to know how to initialize a GActionMap variable. I search here https://developer.gnome.org/gio/stable/GActionMap.html to find a function that instances a GActionMap, but I didn't find it there and anywhere. I was trying to insert some actions in my application, to use the function item = g_menu_item_new(labelItem, "sair"); where item is a menu item, labelItem is a menu item label and sair is the function name that I want to trigger when the item is clicked. But when I run the code, I

How to disable buttons in GTK3

筅森魡賤 提交于 2021-02-04 17:23:27
问题 Windows API has a function called EnableWindow that disables controls so user can't interact with them any more. Is there an equivalent for GTK3 or GTK3++? 回答1: gtk_widget_set_sensitive (widget, FALSE); Note that if you need to check whether a widget is sensitive, gtk_widget_get_sensitive() returns the value set with the above function and gtk_widget_is_sensitive() will tell you whether the widget really is sensitive -- this is affected by parent widgets sensitivity as well. 回答2: For specific

Eclipse的git插件EGit在Linux上提交时的问题与解决

最后都变了- 提交于 2021-02-04 08:01:50
注意:本文所说的问题只出现在Linux上的特定版本的eclipse中。 之前一直都是在windows7上使用eclipse,用着也挺舒心的。最近由于一些原因,需要切换到Linux上去,我选择的是redhat系的fedora,(本文所说的问题应该和具体的发行版无关,因为eclipse官方打包Linux只区分了32位和64位),比起在windows下,界面稍微丑了一点,反应速度慢了一点,但还不错...直到我在进行egit提交的时候,发现了一个大问题。 对于这个问题,开始忍了一段时间(这段时间用eclipse的时间并不多),后来确实觉得这不是办法,于是上网最终还是找到了”解决“办法,这个办法的寻找也比较曲折,在这里记录一下,希望对有同样问题的人有所帮助。 0、问题描述 使用过egit的都知道,在进行提交的时候是会把有改动的文件列表出来供你选择需要提交的,但是我在提交的时候只是显示了文件数目以及那个选择框,并没有看见文件名!刚开始我还以为是我是用的主题或者某一些其他的设置(我使用了第三方的配色方案),后来我几经尝试,甚至还专门下载了官方版本的来试验(我是用的是经过spring定制的STS),最终确定————确实是eclipse自己的原因造成的。 而且同时我还发现了eclipse的dark主题菜单栏根本就看不清 1、找解决办法 再确认不是我自己的问题之后,我就上网找一找

How to send user_data with gtk signals in loop

不羁的心 提交于 2021-01-29 21:53:55
问题 I have signals "make" and "send" registered in core class in main thread. I call call_make() from user class in same thread. call_make() will do some work and fetch some data from worker thread and after return it will emit signal "make". This is code of user class struct my_struct{ int cur_make_id; int cur_send_id; //there may be many id's if multiple signals } void on_send_cb(core, gpointer data){ my_struct *user_data = (my_struct *) data; printf("cure_make_id %d", user_data->cur_make_id);