gtk3

Global keybinding on X using Python gtk3

岁酱吖の 提交于 2019-12-18 18:01:27
问题 I was looking for some example of python xlib global keybinding that would work with gtk3, just as it is done for gtk2 at http://www.siafoo.net/snippet/239. Very similar code here: from Xlib.display import Display from Xlib import X import gtk.gdk import threading import gobject class GlobalKeyBinding (gobject.GObject, threading.Thread): __gsignals__ = { 'activate': (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, ()), } def __init__ (self): gobject.GObject.__init__ (self) threading.Thread.__init

How to style a GtkLabel with CSS?

夙愿已清 提交于 2019-12-18 13:27:18
问题 I'm trying to use CSS to style a GtkLabel. I would like to change the color and font size of the label. Here is my C code: #include <gtk/gtk.h> int main(int argc, char *argv[]) { gtk_init(&argc, &argv); GtkWidget *window = gtk_window_new(GTK_WINDOW_TOPLEVEL); GtkWidget *label = gtk_label_new("Label"); GtkCssProvider *cssProvider = gtk_css_provider_new(); gtk_css_provider_load_from_path(cssProvider, "theme.css", NULL); gtk_style_context_add_provider(gtk_widget_get_style_context(window), GTK

GTK+ 3.0 and GNOME 3 Programming! Any Blog or Book or Tutorial? [closed]

帅比萌擦擦* 提交于 2019-12-18 10:28:11
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . I am new to gtk and gnome programming and like to study GTK+ 3.0 and Gnome 3 programming. Since both of these are recent APIs, I can't find a good tutorial or blog post about these topics. The books I found on GTK+ or GNOME programming are very old ones. So I decided to start with the latest gtk tutorial at http

Compiling a GTK3 program in Visual Studio 2012

拜拜、爱过 提交于 2019-12-18 07:18:32
问题 With the release of Gtk 3 for windows I thought of upgrading my Gtk 2 C application to take advantage of the new GtkGrid widget. The program compiles fine under linux or using MinGW (with codeblocks) under windows, however when I try the same set of files under Visual Studio 2012, giving me 50 or so compilation errors saying gutils.h, gtrashstack.h and gstring.h have a bunch of syntax errors (assuming I only use a basic program, with just a gtk_init and gtk_main). Visual Studio handled gtk2

How to get Gdk window from xid?

a 夏天 提交于 2019-12-18 04:12:38
问题 I'm lost in version 3.. in python2+gdk2 is: #!/usr/bin/env python2 import gtk gtk.gdk.window_process_all_updates() window_xid = 54525964 gdk_window = gtk.gdk.window_foreign_new(window_xid) which is pretty much straight forward. But then, the horror: #!/usr/bin/env python3 from gi.repository import xlib from gi.repository import Gdk from gi.repository import GdkX11 Gdk.Window.process_all_updates() xlib_window = "???????" gdk_display = GdkX11.X11Display.get_default() gdk_window = GdkX11

How to distribute a GTK+ application on Windows?

自古美人都是妖i 提交于 2019-12-17 16:33:28
问题 I have installed GTK+ (specifically GTK3) via MSYS and MinGW on Windows. I now want to copy the GTK+ dlls to my application directory so that it can be run on a computer without a global GTK+ installation. Which dlls are required for GTK+ to operate? 回答1: You have some hints on the Windows page of the GTK+ website. This is the section named Building and distributing your application . It features a blog post about distributing a GTK+ application on Windows. The solution proposed there is to

Where can I download precompiled GTK+ 3 binaries or windows installer? [closed]

爱⌒轻易说出口 提交于 2019-12-17 15:28:51
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 7 months ago . I have taken a look at GTK+3 and I like it. But unfortunately compiling from source has never worked for me. Is there any okace with decent binaries or even better, a windows installer? 回答1: 07/04/2017 update: To make it clear, since 23/06/2017, the GTK+ project doesn't provide binary bundles for Windows. These

Python3: How can I find out what version of GTK+ I am using?

谁说我不能喝 提交于 2019-12-13 19:13:10
问题 I need to find out what version of GTK+ I am using. The problem is there seem to be so many different version numbers involved I am not sure which ones are most relevant. My system is Ubuntu 12.04 and comes as standard with libgtk2.0-0, but when I installed my Python 3.2 development environment I also installed a number of other packages to bind to GTK3. Most of the time this all 'just works', but I want to implement something that (in devhelp) is only available in Version 3.2 of GTK.

Accelerators stop responding when menubar gets hidden

不问归期 提交于 2019-12-13 19:07:13
问题 I have a glade-based UI for gtk3, and I set accelerators fields for several menuitems. I'm not sure what GtkBuilder does exactly behind the scenes when it's loading the glade file (use a global GtkAccelGroup?), but the end result is, when I hide the menubar, the accelerator shortcuts stop working. I'm wondering whether there is a way of getting the accelerators working even when the menu is not visible, while still sticking to glade as much as possible. 回答1: Maybe you can try to stick the

how to style gtk widgets individually with css code

主宰稳场 提交于 2019-12-13 17:27:23
问题 After this GTK+ change font to spin button and this how to apply CSS to GTK+ code? question, I started understanding how to apply a css style to a GTK code, yet there are still a lot confusing details. This is the code with which I create two buttons and three labels: test.c #include <gtk/gtk.h> #include <string.h> static void activate (GtkApplication *app, gpointer user_data) { GtkWidget *window = gtk_application_window_new (app);; GtkWidget *button_01 = gtk_button_new_with_label("This is