gtk3

GTK+3 multithreading

大城市里の小女人 提交于 2019-12-11 13:10:47
问题 I have a program (written in C, currently running on Mac OS X 10.8.4) that simulates a world and updates the world's state multiple times per second. At startup this program creates a background thread which creates a simple GTK window and calls gtk_main . After each time the world's state is updated (in the main thread), I would like the window to reflect that change. My first approach was to simply update the GTK widgets after the world was updated, but because that was in a different

Drag and drop on a fixed container changes its size

冷暖自知 提交于 2019-12-11 11:58:15
问题 I've developed a gtk2 app (Conky Companion) in C to help users of my conky scripts Link: http://crunchbanglinux.org/forums/topic/19235/conky-weather-scripts-using-accuweatherwundergroundnwsweathercom/ create their own conkyrcs with relative ease. A screenshot of the main screen is the following: http://i.imgur.com/jWl88.jpg The user can drag and drop icons or labels from the right side to the left, move them, resize them, change their size or colour, etc. When happy, he can press the generate

Vala can't find gtk+-3.0 Ubuntu 12.04

放肆的年华 提交于 2019-12-11 09:24:16
问题 I'm just starting to learn Vala (under Ubuntu 12.04), and I'm attempting to follow this tutorial; however, at the very first compilation step ( valac --pkg gtk+-3.0 gtktut.vala ), I receive this error: error: gtk+-3.0 not found in specified Vala API directories or GObject-Introspection GIR directories I can't seem to find any information about this on the Internet except that it may mean I don't have the GTK3 .vapi file (there is none in my /usr/share/vala/vapi directory); however, I can't

How to find a key by label from secretstorage collection

只愿长相守 提交于 2019-12-11 08:03:45
问题 I used GnomeKeyring from Gtk3 with Python 2.7 but almost all methodes are deprecated [1]. So I tried to use SecretSecret.Collection [2] import gi gi.require_version('Secret', '1.0') from gi.repository import Secret >> ValueError: Namespace Secret not available I found the package "python-secretstorage" [3] and can access the keyring now: import secretstorage bus = secretstorage.dbus_init() collection = secretstorage.get_default_collection(bus) ## login keyring But how can I find the key I am

How to apply style using GtkSourceView library

故事扮演 提交于 2019-12-11 07:38:50
问题 I'm trying to style a GtkSourceView object in particular I'd like to change the color of line numbers. I'm reading https://developer.gnome.org/gtksourceview/stable/style-reference.html. I'm able to change text but not line-numbers . The document says: line-numbers : Text and background colors for the left margin, on which line numbers are drawn. This is the source: #include <gtk/gtk.h> #include <gtksourceview/gtksource.h> int main (int argc, char *argv[]) { GtkWidget *window, *scrolled_win,

How to compiling C GTK3+ program in Linux mint for windows?

◇◆丶佛笑我妖孽 提交于 2019-12-11 07:32:28
问题 I am using Linux mint and gcc-7 and mingw-w64.I want to compile a c gtk3+ program in Linux using mingw so that it will produce .exe file which can be run in windows.I am able to Compile normal c programs using mingw,But I can't compile gtk programs.I can compile gtk programs with gcc but not with mingw. I had installed mingw as told here :- How to compile executable for Windows with GCC with Linux Subsystem? Now I want to compile window program which I got from https://developer.gnome.org

gtk callback multiple arguments

半腔热情 提交于 2019-12-11 06:55:04
问题 #include <gtk/gtk.h> #include <stdio.h> typedef struct { const gchar *host; } example; void b_clicked (GtkButton *c_button, example *test){ g_print("Hostname: %s\n", test->host); } int main (int argc, char *argv[]){ GtkWidget *window; GtkWidget *grid; GtkWidget *c_button; GtkWidget *q_button; GtkWidget *label_host; GtkWidget *h_name; gtk_init (&argc, &argv); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_title (GTK_WINDOW (window), "FTP Client"); gtk_window_set_position(GTK

Why do I get a zombie when I link assembly code without stdlib?

送分小仙女□ 提交于 2019-12-11 06:36:16
问题 I was experimenting with assembly code and the GTK+ 3 libraries when I discovered that my application turns into a zombie if I don't link the object file with gcc against the standard library. Here is my code for the stdlib -free application %include "gtk.inc" %include "glib.inc" global _start SECTION .data destroy db "destroy", 0 ; const gchar* strWindow db "Window", 0 ; const gchar* SECTION .bss window resq 1 ; GtkWindow * SECTION .text _start: ; gtk_init (&argc, &argv); xor rdi, rdi xor

C - GTK - g_application_quit

谁说胖子不能爱 提交于 2019-12-11 06:07:59
问题 I have a problem with quitting a gtk application. The function call of g_application_quit results in the subsequent error: GLib-GIO-CRITICAL **: g_application_quit: assertion 'G_IS_APPLICATION (application)' failed The code snippet looks like this: g_signal_connect(app_window, "destroy", G_CALLBACK(g_application_quit), app); I tried this also, but still throws the same error: g_signal_connect(app_window, "destroy", G_CALLBACK(g_application_quit), G_APPLICATION(app)); The app got initialized

how to set background color GtkBox in Gtk+3?

二次信任 提交于 2019-12-11 05:20:02
问题 I create application in GTK+3 and I Would like to change the background color for GtkBox but can not here this code: box.modify_bg(Gtk.StateType.NORMAL, color); 回答1: In "Common Questions" of GTK+3 is the answer to your question. In the basic form, you can use: box.override_background_color(Gtk.StateType.NORMAL, Gdk.RGBA(.5,.5,.5,.5)) In this case, the color will be a soft grey, half transparent. Probably, you want to paint it during the draw signal. 来源: https://stackoverflow.com/questions