pygtk

_really_ disable GtkTreeView searching

独自空忆成欢 提交于 2019-12-19 19:04:37
问题 How do I really disable gtk treeview interactive search? The docs say to set_enable_search(False) , but if I do this, CTRL + F still causes an annoying search pop-up to appear. Connecting to start-interactive-search and returning True doesn't work either. 回答1: The pygtk docs don't state this, but the C docs do: gtk_tree_view_set_search_column (GtkTreeView *tree_view, gint column) column : the column of the model to search in, or -1 to disable searching Passing -1 for the column really

_really_ disable GtkTreeView searching

天涯浪子 提交于 2019-12-19 19:04:27
问题 How do I really disable gtk treeview interactive search? The docs say to set_enable_search(False) , but if I do this, CTRL + F still causes an annoying search pop-up to appear. Connecting to start-interactive-search and returning True doesn't work either. 回答1: The pygtk docs don't state this, but the C docs do: gtk_tree_view_set_search_column (GtkTreeView *tree_view, gint column) column : the column of the model to search in, or -1 to disable searching Passing -1 for the column really

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

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

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() >

How to list directory hierarchy in GtkTreeView widget?

雨燕双飞 提交于 2019-12-18 18:40:10
问题 I am trying to generate a hierarchical directory listing in pyGTK. Currently, I have this following directory tree: /root folderA - subdirA - subA.py - a.py folderB - b.py I have written a function that -almost- seem to work: def go(root, piter=None): for filename in os.listdir(root): isdir = os.path.isdir(os.path.join(root, filename)) piter = self.treestore.append(piter, [filename]) if isdir == True: go(os.path.join(root, filename), piter) This is what i get when i run the app: I also think

pygtk window with box that ignores all X(mouse)events (passes them through)

会有一股神秘感。 提交于 2019-12-18 17:25:47
问题 I'd like to do the following: Create a fullscreen, always on top pygtk window with a webkit widget displaying some html, but with a box that is completely transparent, so that the windows below are visible. (This seems to be possible: Is it possible to render web content over a clear background using WebKit?) What I'd like is to (sometimes) pass all mouse events that occur in the transparent box down to the windows below my application's window, so that I can interact with them normally. So

Simple pygtk and threads example please

…衆ロ難τιáo~ 提交于 2019-12-18 09:10:41
问题 Can someone give me a simple example involving threads in this manner, please. Problem with my code is that when I click button One, GUI freezes until its finished. I want buttons to stay responsive when def is being executed. How can i fix that? class fun: wTree = None def __init__( self ): self.wTree = gtk.glade.XML( "ui.glade" ) dic = { "on_buttonOne" : self.one, "on_buttonTwo" : self.two, } self.wTree.signal_autoconnect( dic ) gtk.main() def sone(self, widget): time.sleep(1) print "1"

separate threads in pygtk application

天大地大妈咪最大 提交于 2019-12-18 06:48:37
问题 I'm having some problems threading my pyGTK application. I give the thread some time to complete its task, if there is a problem I just continue anyway but warn the user. However once I continue, this thread stops until gtk.main_quit is called. This is confusing me. The relevant code: class MTP_Connection(threading.Thread): def __init__(self, HOME_DIR, username): self.filename = HOME_DIR + "mtp-dump_" + username threading.Thread.__init__(self) def run(self): #test run for i in range(1, 10):