gtk3

Global hotkey in Python3 using Gtk and XLib

别来无恙 提交于 2020-01-24 14:22:06
问题 My application for X System stays in background (and in panel as indicator) and should popup whenever user hits a key, no matter whatever be the active window. Similar to Menu app. Tried the following: Listening for global key-combinations in python on Linux But can't find how to integrate this Gtk main loop. Global keybinding on X using Python gtk3 The only answer for this question is Python 2 and doesn't work. Mixing the above two, I got the following code: from Xlib.display import Display

How can I change the thickness of a gtkwidget?

♀尐吖头ヾ 提交于 2020-01-16 18:06:09
问题 This image shows a scene in my current app. It looks dumb. The empty gtk list is only taking half the screen. How can I make it take four fifths of the screen and the done button take up one fifth? I am using the C programming language as always and gtk3 which I just upgraded to. I am also having trouble with fat text entries, if there is a way to ajust the thickness of widgets. Making it homogeneous makes them all the same, but how can I make it NOT homogeneous but let me decide how much of

How can I change the thickness of a gtkwidget?

左心房为你撑大大i 提交于 2020-01-16 18:04:06
问题 This image shows a scene in my current app. It looks dumb. The empty gtk list is only taking half the screen. How can I make it take four fifths of the screen and the done button take up one fifth? I am using the C programming language as always and gtk3 which I just upgraded to. I am also having trouble with fat text entries, if there is a way to ajust the thickness of widgets. Making it homogeneous makes them all the same, but how can I make it NOT homogeneous but let me decide how much of

How to use `pkg-config gtkmm-3.0 --cflags --libs` in the Visual Studio Code

只谈情不闲聊 提交于 2020-01-15 10:33:56
问题 How can I configure the tasks.json file so that when I press Ctrl + Shift + B the copier will use pkg-config gtkmm-3.0 --cflags --libs . My file looks like this: "version": "0.1.0", "command": "g++ `pkg-config gtkmm-3.0 --cflags --libs`", "isShellCommand": true, "args": ["main.cpp"] But it returns this message: Failed to launch external program g++ pkg-config gtkmm-3.0 --cflags --libs main.cpp. spawn g++ pkg-config gtkmm-3.0 --cflags --libs ENOENT If I put it as an argument, like this:

Ubuntu 12.10 libgtk-3-0 Missing Symbols

妖精的绣舞 提交于 2020-01-15 08:33:28
问题 I am running Ubuntu 12.10 and somehow my libgtk-3-0 became screwed up. When trying to run many different apps, I get errors like: gedit: symbol lookup error: /usr/lib/libgtk-3.so.0: undefined symbol: g_action_group_action_state_changed I've tried to reinstall libgtk-3-0: sudo apt-get install --reinstall libgtk-3-0 sudo apt-get update sudo apt-get upgrade But still I get this problem - several undefined symbols from libgtk-3.so.0 when trying to run various apps. There is no problem booting the

How to use Gtk.events_pending?

北城余情 提交于 2020-01-15 06:39:59
问题 I've got this basic "test" application, in which I would like to display a spinner while it is doing its long launching process (functions with database requests) to let the user know that it is not bugging but launching. I've read in other posts that it is possible to do this with Gtk.events_pending() function but I don't know how/where to use it. I've tried many ways, but the main window always displays only when requests are done : Here is the main .py file: #!/usr/bin/python3 # -*- coding

How to resize a Gtk.Image in vala

╄→гoц情女王★ 提交于 2020-01-14 19:30:27
问题 I'm trying to resize a Image in vala. So I read valadoc and end up writing this code var img = new Gtk.Image.from_file ("fire.png"); var pix_buf = img.get_pixbuf (); pix_buf.scale_simple (50, 50, InterpType.BILINEAR); window.add (img); But it has no effect. If there is a way to dynamically scale the image so that it fill his container it would be awesome, but just scaling it would be fine. 回答1: Pixbuf.scale_simple does not modify the image. It returns a new Pixbuf that has been scaled. Use

Webkit threads with PyGObject on Gtk3

梦想与她 提交于 2020-01-13 09:31:52
问题 I am trying to load a webkit view on a different thread than main thread for gtk. I see the example PyGTK, Threads and WebKit I slightly modify for support PyGObject and GTK3: from gi.repository import Gtk from gi.repository import Gdk from gi.repository import GObject from gi.repository import GLib from gi.repository import WebKit import threading import time # Use threads Gdk.threads_init() class App(object): def __init__(self): window = Gtk.Window() webView = WebKit.WebView() window.add

Destructing Glib::RefPtr causes failed assertions in the GTK 3 core

╄→гoц情女王★ 提交于 2020-01-12 18:51:50
问题 The guys from Gtkmm are comparing Glib::RefPtr with std::auto_ptr<> : Glib::RefPtr is a smartpointer. Specifically, it is a reference-counting smartpointer. You might be familiar with std::auto_ptr<> , which is also a smartpointer, but Glib::RefPtr<> is much simpler, and more useful. But for some strange reason, I can't get my work done with the RefPtr . The same code is just fine with a auto_ptr . In the following code, SmartPtr is just a placeholder for one of these two smartpointers.

How to have drag-and-drop and sorted GtkTreeView in GTK3?

和自甴很熟 提交于 2020-01-12 06:53:27
问题 I am porting liblarch, a library for handling directed acyclic graphs, from PyGTK (GTK2) to PyGObject introspection (GTK3). I ran into the problem with GtkTreeView. The app using liblarch needs to sort GtkTreeView by a column but in the same time, the user can drag-and-drop rows, move a row under another row. For that I had to manually process dnd_data_get() and dnd_data_receive() which is perfectly okay. There is the minimal setup for GtkTreeView which works under PyGTK. Rows are sorted and