gtk

pyGame within a pyGTK application

删除回忆录丶 提交于 2019-12-19 05:51:24
问题 What is the best way to use PyGame (SDL) within a PyGTK application? I'm searching for a method that allows me to have a drawing area in the GTK window and at the same time being able to manage both GTK and SDL events. 回答1: I've never attempted it myself, but hearing plenty about other people who've tried, it's not a road you want to go down. There is the alternative of putting the gui in pygame itself. There are plenty of gui toolkits built specifically for pygame that you could use. Most of

mkbundle and GTK#

独自空忆成欢 提交于 2019-12-19 04:57:28
问题 I'm trying to use mkbundle so that I can distribute a GTK# application without users needing to install .NET/Mono or GTK#. I've successfully bundled an application which uses winforms, but for some reason when I do the same with a GTK# application it won't work. This is what I get out of cygwin: $ mkbundle --deps a.exe OS is: Windows Sources: 1 Auto-dependencies: True Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'gtk-sharp' or one of its dependencies.

How do I get the size of a pygtk window?

杀马特。学长 韩版系。学妹 提交于 2019-12-19 04:08:19
问题 I'm trying to use gtk.window.get_size(), but it always just returns the default width and height. The documentation says The get_size() method returns a tuple containing the current width and height of the window. If the window is not on-screen, it returns the size PyGTK will suggest to the window manager for the initial window size. The size obtained by the get_size() method is the last size received in a configure event, that is, PyGTK uses its locally-stored size, rather than querying the

How do I get a list of all windows on my gnome2 desktop using pygtk?

半世苍凉 提交于 2019-12-19 03:24:09
问题 I'm a bit confused with some gtk and gnome concepts. I'm trying to get list of non minimized windows on my gnome2 desktop, but after reading the pygtk documentation and inspecting the results, I can't understand the results. Neither of the two snippets below appears to work. First I tried this.. >>> gtk.gdk.window_get_toplevels() [<gtk.gdk.Window object at 0xb74339b4 (GdkWindow at 0x8a4c170)>] >>> gtk.gdk.window_get_toplevels()[0].get_children() [] then this >>> d = gtk.gdk.DisplayManager() >

Bundling GTK3+ with py2exe

半世苍凉 提交于 2019-12-19 03:22:43
问题 Platform is Windows 7 64bit using python 2.7 and GTK3+ installed from http://sourceforge.net/projects/pygobjectwin32/files/?source=navbar The exe is compiled but fails to run, due to this The following modules appear to be missing ['gi.repository.Gdk', 'gi.repository.Gtk', 'overrides.registry'] How can i properly include these files? imports in my .py file from gi.repository import Gtk, Gdk my setup file #!/usr/bin/env python from distutils.core import setup import py2exe, sys sys.path.append

How do I access GUI (GTK) from multi threads?

笑着哭i 提交于 2019-12-18 19:06:26
问题 I have a worker thread spawned from a GUI (for GUI performance), how do I access GUI, such as spawning new windows/widgets from the thread itself? I tried using delegates but it doesn't seem to be working. Any ideas? Possibly examples? Thank you. 回答1: According to their Best Practices: Gtk# is not a thread-safe toolkit, which means that only one thread at a time can safely invoke methods on Gtk#. This thread is typically the thread executing the main loop (which is when control has been

How do I access GUI (GTK) from multi threads?

谁都会走 提交于 2019-12-18 19:05:53
问题 I have a worker thread spawned from a GUI (for GUI performance), how do I access GUI, such as spawning new windows/widgets from the thread itself? I tried using delegates but it doesn't seem to be working. Any ideas? Possibly examples? Thank you. 回答1: According to their Best Practices: Gtk# is not a thread-safe toolkit, which means that only one thread at a time can safely invoke methods on Gtk#. This thread is typically the thread executing the main loop (which is when control has been

Which gtk method I have to use to get temporary path in Ubuntu?

China☆狼群 提交于 2019-12-18 16:57:19
问题 How can I get the temporary directory path in Ubuntu? 回答1: On most Unix-like systems, you'd be looking for /tmp . If that's not quite the answer you were after, you should specify which bit of Ubuntu you're talking about. Certain applications will allow you to specify where their temporary files are put (such as with the TMP , TEMP or TMPDIR environment variables) but a lot of stuff would break under UNIX if /tmp didn't exist, so it's safe just to use that. If you want to make it configurable

Which gtk method I have to use to get temporary path in Ubuntu?

倾然丶 夕夏残阳落幕 提交于 2019-12-18 16:57:08
问题 How can I get the temporary directory path in Ubuntu? 回答1: On most Unix-like systems, you'd be looking for /tmp . If that's not quite the answer you were after, you should specify which bit of Ubuntu you're talking about. Certain applications will allow you to specify where their temporary files are put (such as with the TMP , TEMP or TMPDIR environment variables) but a lot of stuff would break under UNIX if /tmp didn't exist, so it's safe just to use that. If you want to make it configurable

How to handle a custom URL scheme in Webkit GTK?

廉价感情. 提交于 2019-12-18 15:46:15
问题 Let's say I want to use a WebKitWebView in GTK to display some static HTML pages. These pages use a custom URL scheme, let's call it custom:// . This scheme represents a local file whose location is not known beforehand, at the time the HTML is generated. What I do is connect to the navigation-requested signal of the webview, and do this: const gchar *uri = webkit_network_request_get_uri(request); gchar *scheme = g_uri_parse_scheme(uri); if(strcmp(scheme, "custom") == 0) { /* DO FILE LOCATING