gtk

how do I dynamically resize a pixbuf cellrenderer in a treeview?

末鹿安然 提交于 2021-02-20 19:33:22
问题 I'm using a Gtk3 TreeView that looks like above. The model is a Gtk.TreeStore Gtk.TreeStore(str, GdkPixbuf.Pixbuf) For the picture I could add to the model the correctly sized images via: pixbuf.scale_simple(48,48,GdkPixbuf.InterpType.BILINEAR) However I'm also using the model elsewhere showing the pixbufs in a different manner and the pixbufs can also be a variety of sizes. What I would like to do is force the size of the picture displayed at run-time. The question is - how do I do that? I

How can I get the full file path of an icon name?

余生长醉 提交于 2021-02-18 21:10:05
问题 How can I get the full file path from an icon name in GNOME? 回答1: import gtk icon_theme = gtk.icon_theme_get_default() icon_info = icon_theme.lookup_icon("my-icon-name", 48, 0) print icon_info.get_filename() 回答2: Translation for Python 3: from gi.repository import Gtk icon_theme = Gtk.IconTheme.get_default() icon_info = icon_theme.lookup_icon("my-icon-name", 48, 0) print(icon_info.get_filename()) 来源: https://stackoverflow.com/questions/6090241/how-can-i-get-the-full-file-path-of-an-icon-name

Find type of GTK widgets

北慕城南 提交于 2021-02-18 19:40:14
问题 I'am working on GTK in python after creating a CheckButton or Button with: x = Gtk.CheckButton() y = Gtk.Button("Config") I want to check type of x or y When use type() it returns <class 'gi.repository.Gtk.CheckButton'> or <class 'gi.overrides.Gtk.Button'> Is it possible to check It's type in another way ? 回答1: The idiomatic way to check if a variable is an instance of a specific type is using isinstance() , e.g.: >>> import gi >>> gi.require_version('Gtk', '3.0') >>> from gi.repository

How to intergrate PDF viewer(display) in the GTK+ interface

Deadly 提交于 2021-02-18 19:16:47
问题 Am working on the project in which am required to fetch files from the server and to display them on the client post.All of this is to be done in the UNIX environment where I used C language for coding client and server and GTK+ for the interface which will display files in the PDF format. My problem is I do not know how can I intergrate a PDF viewer in such interface. As the final results I would like when I select the file and click GTKbutton it displays the file in a PDF format in that

How can I get the default colors in GTK?

筅森魡賤 提交于 2021-02-18 10:14:57
问题 Context In GTK 3, people can set their own themes. Even the default theme (Adwaita) is provided with two variants: a light one and a dark one. As I am writing my own widget (in python), I need to get these colors in order to avoid drawing black on black or white on white. Question How can I access the default colors of the user GTK theme? Things that don't work GtkSettings used to provide an acceptable gtk-theme-color property, but it is not there anymore and there is no reference in the doc

How can I get the default colors in GTK?

烂漫一生 提交于 2021-02-18 10:14:16
问题 Context In GTK 3, people can set their own themes. Even the default theme (Adwaita) is provided with two variants: a light one and a dark one. As I am writing my own widget (in python), I need to get these colors in order to avoid drawing black on black or white on white. Question How can I access the default colors of the user GTK theme? Things that don't work GtkSettings used to provide an acceptable gtk-theme-color property, but it is not there anymore and there is no reference in the doc

How can I get the default colors in GTK?

馋奶兔 提交于 2021-02-18 10:13:15
问题 Context In GTK 3, people can set their own themes. Even the default theme (Adwaita) is provided with two variants: a light one and a dark one. As I am writing my own widget (in python), I need to get these colors in order to avoid drawing black on black or white on white. Question How can I access the default colors of the user GTK theme? Things that don't work GtkSettings used to provide an acceptable gtk-theme-color property, but it is not there anymore and there is no reference in the doc

Making rows in a GTK TreeView unselectable

人走茶凉 提交于 2021-02-18 08:48:09
问题 I want to make select rows of a PyGTK Tree-view (coupled to a List Store) un-selectable and if possible,greyed out. Is there a way to do this? 回答1: This is a bit hackish minimal code, but it will make it impossible to select the middle row ('B'). If you wish that the previous selection should be remembered it ought to be quite easy to just store which rows are selected at the end of the signal-callback and overwrite current selection if a bad row was selected. As for the individual rows and

Android Studio OpenCV NDK: Unspecified error, The function is not implemented

 ̄綄美尐妖づ 提交于 2021-02-16 20:46:09
问题 I write in Android Studio on Windows. And I use OpenCV in my native c++ code.When calling the function, I get this error in logcat: "OpenCV Error: Unspecified error (The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script) in cvShowImage, file /Volumes/Linux/builds/master_pack-android/opencv/modules/highgui/src/window.cpp, line 545". I found

GUI Freezes when clicking a button in PyGtk

本小妞迷上赌 提交于 2021-02-11 13:10:33
问题 I know this may be a recurring question, but I don't get the point in the other answers to that problem. First of all, here is my code (if you want syntax highlighting) : http://pastebin.com/9uJah8t2 #!/usr/bin/python2.7 from mega import Mega import pygtk import gtk import glib class HelloWorld: #def onSuccess(self, widget, data): def test(self, widget, data): email = self.login.get_text() password = self.password.get_text() mega = Mega() m = mega.login(email, password) details = m.get_user()