gtk3

GTK3 function keys; which are consumed (and unusable from my GTK app)?

别说谁变了你拦得住时间么 提交于 2020-01-04 07:04:06
问题 FWIW, the exact program motivating this question is (on Linux/Debian/Sid/x86-64) my bismon on github, commit d43a75fb9f8e13. GTK3 is 3.22.24. If you need to try it, build it with make and run ./bismon . It is in alpha stage, and still not interesting to others than me. It is some kind of DSL interpreter with a GTK interface and a persistent heap. If you want something to appear, click to focus on the middle widget, type the_system there followed by Ctrl Return , but that is not relevant for

CSS styling in GTKSharp

本小妞迷上赌 提交于 2020-01-04 05:27:10
问题 I'm converting a C/GTK+ GUI application to C# using GTKSharp in VS2017. I've installed this package https://www.nuget.org/packages/GtkSharp/3.1.3 via NuGet. Here's how I load up the CSS (the application uses a Glade file to define the interface): static void Main(string[] args) { new Program(args); } public Program(string[] args) { Application.Init(); builder = new Builder(); Gtk.CssProvider provider = new CssProvider(); builder.AddFromFile("interface.glade"); provider.LoadFromPath("style.css

Can't set CSS to specified widget in GTK+

白昼怎懂夜的黑 提交于 2020-01-03 04:21:12
问题 I'm using Vala with GTK+ and now I'm trying to add custom CSS to specified widget. I can add fe. backgroudn to GtkWidget but not for #sidebar #sidebar { //It doesn't work color: white; } GtkWindow { // It works background-color: red; } I'm adding class to widget like that: sidebar = new Gtk.Label("Hello"); sidebar.set_name("sidebar"); And it's changes color to GtkWindow, but not for this label. Any ideas? 回答1: I haven't programmed in Vala, but you should add class to StyleContext. This is in

Glib-GIO-ERROR when opening an file chooser dialog

感情迁移 提交于 2020-01-02 10:11:26
问题 I use GTK3 , codeblcks IDE, glade3 in windows 7... In my application i have a button which when clicked should open a gtk_file_chooser_dialog... But gives the fillowing error.. Glib-GIO-ERROR** : No GSettings schemas are installed on the system static void on_save_clicked(GtkWidget *widget,gpointer data) { GtkWidget *dialog; //dialog=gtk_file_chooser_dialog_new("Save it",GTK_WINDOW(gtk_builder_get_object(builder,"mainwindow")),GTK_FILE_CHOOSER_ACTION_SAVE,GTK_STOCK_OK,GTK_RESPONSE_OK,GTK

Passing additional arguments to gtk function

坚强是说给别人听的谎言 提交于 2020-01-02 08:43:21
问题 I'm trying to learn how to make GUIs using gtk+ 3.0. I want to pass a simple argument, an integer, to a callback function, so that when I press the button the value of the argument changes. Here's my code: #include <gtk/gtk.h> void buttonFunction(GtkWidget * widget, gpointer data, int & n){ n = 1; } int main(int argc, char ** argv){ int n = 0; GtkWidget * window; GtkWidget * button; gtk_init(&argc,&argv); window = gtk_window_new(GTK_WINDOW_TOPLEVEL); button = gtk_button_new_with_label("Osss")

Passing additional arguments to gtk function

情到浓时终转凉″ 提交于 2020-01-02 08:43:07
问题 I'm trying to learn how to make GUIs using gtk+ 3.0. I want to pass a simple argument, an integer, to a callback function, so that when I press the button the value of the argument changes. Here's my code: #include <gtk/gtk.h> void buttonFunction(GtkWidget * widget, gpointer data, int & n){ n = 1; } int main(int argc, char ** argv){ int n = 0; GtkWidget * window; GtkWidget * button; gtk_init(&argc,&argv); window = gtk_window_new(GTK_WINDOW_TOPLEVEL); button = gtk_button_new_with_label("Osss")

is GTK 3.x a real cross-platform solution?

青春壹個敷衍的年華 提交于 2020-01-02 06:50:46
问题 I have tasted both Qt 4.x/5.x and GTKmm 3.x and I really like GTKmm over Qt. Now I have just discovered that GTKmm 3.x doesn't offer a Windows porting, they also do not offer a Mac porting, basically I can't find nothing but libraries/sources/binaries for Linux. Apparently the Windows support ( I'm not sure about the situation for the Mac OS stuff ) was dropped in the 2.x era and it's still not-existing today. I have planned to use GTK 3.x for specific reasons, especially for some new

Unable to connect signal and signal handler in Glade GTK+3

拈花ヽ惹草 提交于 2020-01-02 05:40:08
问题 Hi i'm working on a project in GTK+ 3 on Ubuntu 14.04 LTS. I'm trying to use Glade,but when i tried to connect a "toggled" signal of toggle button to a function called kaczka ,after compiling i got this in my console: (Gra_w_Statki:11072): Gtk-Warning**:Could not find signal handler 'kaczka. Did you compile with -rdynamic? The window and the button render itself and work normally except of that toggling button doesn't change anything. What am i doing wrong ? This is how i tried to connect

Install Gtk 3 for python on mac

[亡魂溺海] 提交于 2020-01-02 02:23:29
问题 I have installed python gtk3 using homebrew but it prints Warning: gtk+3-3.14.6 already installed but when i try to import it in python from gi.repository import Gtk it gives the error ImportError: No module named gi.repository Please help. 回答1: When I installed only pygobject3 I got the following error when running a python script: gi.require_version('Gtk', '3.0') File "/usr/local/lib/python2.7/site-packages/gi/__init__.py", line 102, in require_version raise ValueError('Namespace %s not

How does one add an item to GTK's “recently used” file list from Python?

非 Y 不嫁゛ 提交于 2020-01-02 00:27:05
问题 I'm trying to add to the "recently used" files list from Python 3 on Ubuntu. I am able to successfully read the recently used file list like this: from gi.repository import Gtk recent_mgr = Gtk.RecentManager.get_default() for item in recent_mgr.get_items(): print(item.get_uri()) This prints out the same list of files I see when I look at "Recent" in Nautilus, or look at the "Recently Used" place in the file dialog of apps like GIMP. However, when I tried adding an item like this (where /home