gtk3

How to build a GTK+3 program on Windows without MSYS2?

偶尔善良 提交于 2020-05-15 02:52:58
问题 I want to compile a code in GTK+3. Without using MSYS2 nor Visual Studio. I'm getting "undefined reference to" First, tried with this tutorial from the official page: https://www.gtk.org/download/windows.php but it was a mess using MSYS2; plus, i dont want a linux like nor a unix like environment (a lot less Visual Studio). I downloaded the "all in one bundle" for version 2, setted up the enviroment variable an all that stuff. Everything worked fine, the code compiled! (a code from version 2)

How to build a GTK+3 program on Windows without MSYS2?

人盡茶涼 提交于 2020-05-15 02:52:05
问题 I want to compile a code in GTK+3. Without using MSYS2 nor Visual Studio. I'm getting "undefined reference to" First, tried with this tutorial from the official page: https://www.gtk.org/download/windows.php but it was a mess using MSYS2; plus, i dont want a linux like nor a unix like environment (a lot less Visual Studio). I downloaded the "all in one bundle" for version 2, setted up the enviroment variable an all that stuff. Everything worked fine, the code compiled! (a code from version 2)

Python and Webkit, watching serial port thread, how to avoid core dump running javascript

孤街浪徒 提交于 2020-03-26 04:48:21
问题 I'm writing a game that uses python and webkit, and a webpage is the front-end/GUI. The PC is connected to an Arduino that controls a coin hopper and other i/o. When the Arduino sends 'coinin' over serial, I capture this in a serial-watching thread, then run some javascript on the webpage to 'add' a coin to the game. For simplicity in troubleshooting, I set up an example that runs a test thread instead of reading serial, but the problem is the same. The thread tries to add a coin every second

GTK Retrieve values from multiple widgets on button press

巧了我就是萌 提交于 2020-03-25 16:50:20
问题 I'm trying to retrieve a value from both an Entry field and a ComboBox in my window on a button press. I'm currently struggling to do so. I've been told that in order to get multiple value, I need to use structs. However I'm struggling to get it to work. Here is what I have so far: Function to be run on button press: struct data { GtkWidget *hash; GtkWidget *hashType; }; static void queue_hash (struct data *dataStruct) { GtkWidget *hashWid = dataStruct->hash; GtkWidget *hashTypeWid =

GTK Retrieve values from multiple widgets on button press

吃可爱长大的小学妹 提交于 2020-03-25 16:48:11
问题 I'm trying to retrieve a value from both an Entry field and a ComboBox in my window on a button press. I'm currently struggling to do so. I've been told that in order to get multiple value, I need to use structs. However I'm struggling to get it to work. Here is what I have so far: Function to be run on button press: struct data { GtkWidget *hash; GtkWidget *hashType; }; static void queue_hash (struct data *dataStruct) { GtkWidget *hashWid = dataStruct->hash; GtkWidget *hashTypeWid =

Glade - Invalid object type 'WebKitWebView' when loading from file. works on Glade Application

怎甘沉沦 提交于 2020-03-25 12:59:46
问题 I am building a python GTK application and I used Glade to define the interface. (using the Glade Interface Designer). Everything look good on Glade but when I try to create the GUI from my Python program it gives a error loading Webkit related views: Glade - Invalid object type 'WebKitWebView' It works fine in Glade Designer and also if I create the widgets manually, but the Builder doesn't like it. I am building the ui like this: GtkBuilder = Gtk.Builder.new_from_file("glade/main.glade")

How do you set an enum property on a GLib object?

半腔热情 提交于 2020-02-16 05:50:08
问题 I am trying to set the "ellipsize" enum property on a GtkCellRendererText object. I am trying to use g_object_set_property as follows: GtkCellRenderer *renderer = gtk_cell_renderer_text_new (); GValue val = G_VALUE_INIT; g_value_init (&val, G_TYPE_ENUM); g_value_set_enum (&val, PANGO_ELLIPSIZE_END); g_object_set_property (G_OBJECT(renderer), "ellipsize", &val); However, I get an error message at run time: (infog:27114): GLib-GObject-WARNING **: 12:24:29.848: ../../../../gobject/gvalue.c:188:

How do you set an enum property on a GLib object?

自闭症网瘾萝莉.ら 提交于 2020-02-16 05:49:28
问题 I am trying to set the "ellipsize" enum property on a GtkCellRendererText object. I am trying to use g_object_set_property as follows: GtkCellRenderer *renderer = gtk_cell_renderer_text_new (); GValue val = G_VALUE_INIT; g_value_init (&val, G_TYPE_ENUM); g_value_set_enum (&val, PANGO_ELLIPSIZE_END); g_object_set_property (G_OBJECT(renderer), "ellipsize", &val); However, I get an error message at run time: (infog:27114): GLib-GObject-WARNING **: 12:24:29.848: ../../../../gobject/gvalue.c:188:

pygobject creating a drag and drop source

非 Y 不嫁゛ 提交于 2020-02-05 07:20:22
问题 from gi.repository import Gtk, Gdk def drag_data_get_cb(widget, drag_context, selection_data, info, time): print selection_data.get_data_type() print widget.get_text() return widget.get_text() def drag_begin_cb(widget, dragcontext): print dragcontext, widget return dragcontext label = Gtk.Label() label.drag_source_set(Gdk.ModifierType.BUTTON1_MASK, [], Gdk.DragAction.COPY) label.set_text("Drag Me!") label.connect("drag_data_get", drag_data_get_cb) label.connect("drag_begin", drag_begin_cb)

Make GTK Entry only focusable on click but gain keyboard control if selected

北慕城南 提交于 2020-01-25 10:13:58
问题 I have a GtkBox with some GtkEntry elements inside. Some of them should not be focused by keyboard-tab. Only when clicking on them. How can this be achieved? If I set gtk_widget_set_can_focus to FALSE for an Entry I solved the focus problem. But cannot interact with the keyboard anymore. What is a proper solution for not accepting focus by keyboard but on click within Gtk 3.18.9? 回答1: You can use gtk_container_set_focus_chain() for that. 来源: https://stackoverflow.com/questions/59680184/make