gtk2

Get colors of current gtk style

我只是一个虾纸丫 提交于 2019-12-19 09:41:43
问题 I use PyGTK and I want to get colors of a widget (for example bg color), I run such a code: gdkColorToRgb = lambda gc: (gc.red//257, gc.green//257, gc.blue//257) widget = gtk.HBox() ## for example style = widget.get_style() for i in range(5): print i, gdkColorToRgb(style.bg[i]) But it does not give colors of my current gtk theme(style). It seems to be for default gtk theme (my current theme is dark, while this code gives light colors) I use ArchLinux and PyGTK 2.24.0 (GTK 2.24.5) 回答1: I just

GLib-CRITICAL **: Source ID XXX was not found when attempting to remove it

可紊 提交于 2019-12-17 23:32:18
问题 I made a treeview with a treestore as model. The window is shown as expected, but when I click in the "+" to expand the items, I get this message: GLib-CRITICAL **: Source ID 221 was not found when attempting to remove it Here is my code: #include <gtk/gtk.h> /* compile with: */ /* gcc main.c -o boxy `pkg-config --cflags --libs gtk+-2.0` */ typedef struct { GtkWidget *toplevel; GtkWidget *treeview; } Widgets; enum { ITEM_PARENT, ITEM_CHILD }; typedef struct { gint tipo; gint id; gchar *nombre

GTK Modifying Background Color of GtkButton

折月煮酒 提交于 2019-12-17 19:44:28
问题 Trying to change background/foreground color....Using Gtk+ and C. GdkColor color; gdk_color_parse( "#0080FF", &color ); gtk_widget_modify_fg( GTK_WIDGET(button), GTK_STATE_SELECTED, &color ); gtk_widget_modify_fg( GTK_WIDGET(button), GTK_STATE_NORMAL, &color ); I am using above functionality but it is not giving any results. I am looking for something asked in this question(But in C): GTK: create a colored regular button how to Change Style of Button using button Style? Can anybody provide

Is there a way to make changes to the titlebar with GTK2?

本秂侑毒 提交于 2019-12-14 03:55:07
问题 I have a desktop application written in Ruby that is using GTK2. It's just a small test application to play with GTK2, but I'm having problems achieving what I want to do. Is there any way using GTK2 to get at the titlebar (apart from setting the title), specifically to either add a button to it (beside the min/max/etc, B in the below diagram) or to add an option to the menu that pops up when you click the icon on the titlebar (A in the below diagram)? I'm thinking there might not be because

Ubuntu 16.04: fatal error: X11/Xlib.h: No such file or directory

﹥>﹥吖頭↗ 提交于 2019-12-13 00:44:25
问题 I am trying to install Rgtk2 (dependency for rattle). I am using R thru Anaconda. I am getting the following error. In file included from Rgtk.c:7:0: /usr/include/gtk-2.0/gdk/gdkx.h:32:10: fatal error: X11/Xlib.h: No such file or directory #include <X11/Xlib.h> ^~~~~~~~~~~~ I tried the following workarounds as found in StackOverflow and other blogs. Installed libx11-dev, mesa-common-dev, libglu1-mesa-dev, libxrandr-dev, libxi-dev Tried installing RGtk2_2.20.31 from source. Every time I am

pygtk how to update gtk.Image

痞子三分冷 提交于 2019-12-12 10:19:26
问题 I have very strange problem with gtk.Image(). Simple question; how to update image? On window creation I create image and pack it… On that time I load image from disk. Now I start downloading image from url, and when it's done I just want to replace existing image with new one. I rewrite content of same file on disk and then do: pixbuf = gtk.gdk.pixbuf_new_from_file(image_path) self._user_avatar.set_from_pixbuf(pixbuf) I have tried self._user_avatar.set_from_file(image_path) and self._user

RGTK2 block user input while processing

∥☆過路亽.° 提交于 2019-12-12 04:57:17
问题 I have written a GUI in R with RGTK2 and Tcltk that does a lot of fairly heavy calculations and aggregations on big data sets. I would like to find a way to stop the user interface from accepting user inputs while it is processing a large data set, and ideally, change the interface color, popup a dialogue, or change the mouse pointer to an hourglass/spinner to indicate to users that the application is active. The implementation that I want would look something like: gSignalConnect

Invisble GtkEventBox vs cursor change

北慕城南 提交于 2019-12-11 17:25:58
问题 In my application, sometimes I need to disable most of the buttons and event boxes while a process is taking place (except the "cancel" button of course). Each event box contains a label which can be clicked. To make the user understand that these labels are clickable, I have underlined the texts and have made the cursor change when hovered over those labels. The problem is that when I disable an event box (make it insensitive), you can see a rather ugly artifact: So, I searched and found

Installing matplotlib on Mac OS X 10.9

大憨熊 提交于 2019-12-11 13:56:04
问题 As a requirement to install OCRopus, I have successfully installed matplotlib on Mac OS X 10.9.1 by pip : $ sudo pip install matplotlib But after installing OCRopus the test didn't work because of laking this module: matplotlib.backends._backend_gdk . Reading this document and this question convinced me that my problems might gone if I reinstall matplotlib through: $ sudo port install py27-matplotlib +gtk2 But on Mac OS X 10.9.1 it seems there is a bug which I receive this error: Error:

How to listen socket, when app is running in gtk.main()?

眉间皱痕 提交于 2019-12-11 08:29:32
问题 I've tried to search, but nothing seems to work. For example: Separate threads I am currently writing simple communication app in Python2.7 with PyGTK. I have background process, which is listening socket in while loop like that. I want to display message, when I receive it form server. But when I start gtk.main(), it obviously starts to loop again, so my listening loop doesn't working. I need to display new window for each message or close old window and display new window with all unread