gtk

Gtk-WARNING **: Locale not supported by C library. while using several Python modules (mayavi, spectral)

℡╲_俬逩灬. 提交于 2019-12-20 02:36:06
问题 I updated my MacBook to Mavericks, reinstalled Macports and all Python 2.7 modules I usually use. While running Python I get the following messages: when importing mlab: from mayavi import lab (process:1146): Gtk-WARNING **: Locale not supported by C library. Using the fallback 'C' locale. when running a mlab command such as mlab.mesh(), the display window opens, shows no content and freezes. I don't get this message while importing spectral, but I get it when running view_cube() the display

Why does cloning data inside a closure not prevent the error “closure may outlive the current function”?

会有一股神秘感。 提交于 2019-12-20 02:15:08
问题 I built a GTK application with gtk-rs. When I build the main window, I want to use some dynamic parameters such as window height. I created a struct which contains all such settings and want to use this as an input parameter for the function building the UI: fn main() { let application = gtk::Application::new(Some("id"), Default::default()) .expect("Initialization failed..."); let config = Config {width: 100., height: 100.}; application.connect_activate(|app| { build_ui(app, config.clone());

_really_ disable GtkTreeView searching

末鹿安然 提交于 2019-12-19 19:04:52
问题 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: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

How do I change the property of a GTK widget such as a stack?

我的未来我决定 提交于 2019-12-19 09:15:15
问题 I've been taking a quick look at the GTK 3.10 documentation for a GtkStack. https://developer.gnome.org/gtk3/3.10/GtkStack.html It mentions that the child added to a GtkStack is given a property "icon-name". My question is - how can I change the value of this property. The reason - I want to change the GtkStackSwitcher button to be an icon not text but I want to code this - not use a GktBuilder UI. If you look at the gtk3-demo - Stack demo and the UI file you can see the GtkSwitcher has an

How to add compiler arguments using CMake?

瘦欲@ 提交于 2019-12-19 09:03:10
问题 I have been using the Clion IDE and am trying to get a simple GTK program to compile using it. I have found that Clion uses CMake, so the issues is here rather than with the IDE itself. I am able to successfully compile and run the program directly from the terminal but have been unsuccessful using CMake. The problem is simple: when I attempt to compile, the compiler cannot find gtk.h, which is located in /usr/include/gtk-3.0/gtk/gtk.h . I have found that somehow the command compiler argument

How to paste HTML to clipboard with GTK+

巧了我就是萌 提交于 2019-12-19 08:54:16
问题 How do I paste HTML to the clipboard so that it is recognized as HTML in applications such as Open Office and MS Word? It is possible when using gtkhtml or gecko if you've already rendered it, but I need a straight GTK+ solution. 回答1: You call gtk_clipboard_set_with_data or gtk_clipboard_set_with_owner, passing a GtkTargetEntry with "text/html" as the value for the target field. It's good practice to also provide "UTF8_STRING" and "STRING" targets for applications that don't support HTML.

How to get program path [duplicate]

旧巷老猫 提交于 2019-12-19 08:54:13
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: how to find the location of the executable in C I'm writting an multi-platform app in C++ using GTK+ and I have a problem. I must get program path. E.g., when program is in /home/user/program (or C:\Users\user\program.exe ), i have /home/user/ (or C:\Users\user\ ). Can and how I can do this? 回答1: argv[0] contains the program name with path. Am I missing something here? 回答2: For Win32/MFC c++ programs: char

How to create a complete menu using GIO Actions in PyGI GTK?

╄→гoц情女王★ 提交于 2019-12-19 06:30:10
问题 I'm trying to convert the menubar in my Gtk app so it will use GActions (from the Gio) as opposed of GtkActions in Python3 using GObject Instrospection. I've been trying to figure it out on my own but so far it seems awfully complicated and I didn't have much luck with it. If someone could please post an example of how to create a simple menu GAction based with A submenu A menu item with a stock ID icon / hotkey A menu item with a non-stock icon / hotkey A checked menu item And radio menu