gtk3

how do I dynamically resize a pixbuf cellrenderer in a treeview?

末鹿安然 提交于 2021-02-20 19:33:22
问题 I'm using a Gtk3 TreeView that looks like above. The model is a Gtk.TreeStore Gtk.TreeStore(str, GdkPixbuf.Pixbuf) For the picture I could add to the model the correctly sized images via: pixbuf.scale_simple(48,48,GdkPixbuf.InterpType.BILINEAR) However I'm also using the model elsewhere showing the pixbufs in a different manner and the pixbufs can also be a variety of sizes. What I would like to do is force the size of the picture displayed at run-time. The question is - how do I do that? I

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

Signal ::expose-event is invalid for GdkWindow and GdkX11Window

微笑、不失礼 提交于 2021-02-10 18:00:41
问题 I had this following code pull from one of the tutorials on line. When I use gtk+-2.0, the following code works fine. But when I try compile with gtk+-3.0, the code gives this error: signal 'expose-event' is invalid for instance of type 'GtkWindow' So I try to do the following, but still doesn't help. And it gives another error: signal 'expose-event' is invalid for instance of type 'GdkX11Window' gtk_widget_realize(window); GdkWindow *gdkwin = gtk_widget_get_window(Gwindow); int main(int argc

How to add an image to a button with GTK

跟風遠走 提交于 2021-02-10 07:14:59
问题 I am trying to add an image to a button with label, but the image doesn't show and the broken image doesn't display either. stop_button = gtk_button_new_with_label("stop"); image = gtk_image_new_from_file ("/home/cendit/Escritorio/index.jpeg"); gtk_button_set_image (GTK_BUTTON(stop_button),image); I tried a different path "file:///home/cendit/Escritorio/index.jpeg" but it was not successful. 回答1: Images inside buttons are not visible by default, as we transitioned from GTK+ 2.x to 3.x. Sadly,

How to add an image to a button with GTK

扶醉桌前 提交于 2021-02-10 07:14:20
问题 I am trying to add an image to a button with label, but the image doesn't show and the broken image doesn't display either. stop_button = gtk_button_new_with_label("stop"); image = gtk_image_new_from_file ("/home/cendit/Escritorio/index.jpeg"); gtk_button_set_image (GTK_BUTTON(stop_button),image); I tried a different path "file:///home/cendit/Escritorio/index.jpeg" but it was not successful. 回答1: Images inside buttons are not visible by default, as we transitioned from GTK+ 2.x to 3.x. Sadly,

How to add an image to a button with GTK

雨燕双飞 提交于 2021-02-10 07:13:38
问题 I am trying to add an image to a button with label, but the image doesn't show and the broken image doesn't display either. stop_button = gtk_button_new_with_label("stop"); image = gtk_image_new_from_file ("/home/cendit/Escritorio/index.jpeg"); gtk_button_set_image (GTK_BUTTON(stop_button),image); I tried a different path "file:///home/cendit/Escritorio/index.jpeg" but it was not successful. 回答1: Images inside buttons are not visible by default, as we transitioned from GTK+ 2.x to 3.x. Sadly,

How to add an image to a button with GTK

做~自己de王妃 提交于 2021-02-10 07:12:04
问题 I am trying to add an image to a button with label, but the image doesn't show and the broken image doesn't display either. stop_button = gtk_button_new_with_label("stop"); image = gtk_image_new_from_file ("/home/cendit/Escritorio/index.jpeg"); gtk_button_set_image (GTK_BUTTON(stop_button),image); I tried a different path "file:///home/cendit/Escritorio/index.jpeg" but it was not successful. 回答1: Images inside buttons are not visible by default, as we transitioned from GTK+ 2.x to 3.x. Sadly,

Setting GtkEntry font from Pango.FontDescription

爷,独闯天下 提交于 2021-02-08 13:35:14
问题 I have a GtkEntry that's I'd like to allow users to style with their choice of font (or system default). I end up with a Pango description string like "Monospace 10" to describe the font. I'm currently using override_font , which is deprecated in favour of CSS styling. I'd like to at least attempt to do it "right", but it seems like a pretty convoluted and fragile workflow now to get the CSS from the Pango string. Here's an example from Github: def _get_editor_font_css(): """Return CSS for