gtk3

How to unfocus (blur) Python-gi GTK+3 window on Linux

☆樱花仙子☆ 提交于 2020-07-06 10:40:29
问题 What I want to do and why I want my window to unfocus, so the previous focused window is selected. Why? I want to interact with the previously selected window (from other programs). My current plan is: unfocus my window, use libxdo to simulate keystrokes, then focus my window again. My window can be set on top to help avoid flicking. Should be good enough. Looks simple to me. But I can't get it to work. What I've tried so far Hiding the window with Gtk.Widget.hide() and then showing it again:

gtk3 - persisting shortcuts while using GSimpleAction

浪子不回头ぞ 提交于 2020-06-29 03:19:19
问题 In gtk3 there is the possibility to persist accelerator keys and pathes to file by using gtk_accel_map. The user is able to customize shortcuts by editing the related file. Now I am about to replace the deprected GtkAction interface by making use of GSimpleAction. So how can I get the required parametrs for gtk_accel_map_add_entry out of a GSimpleAction (or out of a GActionMap?), so that I can persist it ? I defined the GSimpleAction like that: void callback ( GSimpleAction *action, GVariant

gtk3 - persisting shortcuts while using GSimpleAction

余生颓废 提交于 2020-06-29 03:19:09
问题 In gtk3 there is the possibility to persist accelerator keys and pathes to file by using gtk_accel_map. The user is able to customize shortcuts by editing the related file. Now I am about to replace the deprected GtkAction interface by making use of GSimpleAction. So how can I get the required parametrs for gtk_accel_map_add_entry out of a GSimpleAction (or out of a GActionMap?), so that I can persist it ? I defined the GSimpleAction like that: void callback ( GSimpleAction *action, GVariant

Decrease the tabs bar height in gnome terminal

社会主义新天地 提交于 2020-06-25 07:53:46
问题 I recently installed Lubuntu 16.04 with gnome-terminal. I like gnome-terminal to consume less space on monitor. But latest version comes with two annoying buttons at the right top corner which makes no sense to me. Because, user who prefer terminals are more likely to use keyboard shortcuts to do tabs operations rather than go for mouse clicks. With these two extra buttons tabs bar got wider and uses more space on the monitor. Click here for Screenshot . Please help me in removing this extra

Why does the subfunction not destroy the GtkWindow?

|▌冷眼眸甩不掉的悲伤 提交于 2020-06-23 14:14:28
问题 This is my code: void window_first(); void enter_window2(GtkWidget* w, gpointer data); void quit(GtkWidget* w, gpointer data); void quit(); int main(int argc, char* argv[]) { GtkWidget* window2; gtk_init(&argc, &argv); window_first(); window2 = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_widget_show_all(window2); g_signal_connect(G_OBJECT(window2), "destroy", G_CALLBACK(gtk_main_quit), NULL); gtk_main(); return 0; } void quit(GtkWidget* w, gpointer data) { exit(1); } void enter_window2(GtkWidget

How to prevent GtkWindow growing?

隐身守侯 提交于 2020-06-17 02:53:05
问题 This is my codes: #include<gtk/gtk.h> int main(int argc,char**argv) { GtkWidget* window, *button, *grid; gtk_init(&argc,&argv); window = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size(GTK_WINDOW(window),100,100); g_signal_connect(G_OBJECT(window),"destroy",G_CALLBACK(gtk_main_quit),NULL); //gtk_container_set_border_width(GTK_CONTAINER(window),10); gtk_window_set_resizable(GTK_WINDOW(window), FALSE); grid = gtk_grid_new(); button = gtk_button_new_with_label("1"); gtk_grid

Drawing lines with GTK+ and Cairo without removing what is already drawn

╄→гoц情女王★ 提交于 2020-05-31 06:54:40
问题 Currently I am writing a program in C, on a linux system (Raspberry Pi to be exact) which should draw to a GTK window using Cairo. I've been following the tutorial at: http://zetcode.com/gfx/cairo/ . But it is way to vague with it's explanations at certain points. It does not explain two points that I really need: I can't figure out a way to draw to the window with a proper function call. It removes what is already drawn. I need a piece of code that does some simple things, in a very Object

How to get the current Linux theme with Python?

六月ゝ 毕业季﹏ 提交于 2020-05-29 11:27:06
问题 I need to get the current Icon Theme in the system. The problem is that there are a lot of environments as GNOME, XFCE, MATE... Please, how could I get the current Icon Theme ? I'm thinking that it'll be with Gtk.IconTheme.get_default() , but I didn't get a good result. Thanks in advance! 回答1: Unfortunately, there is no universal solution for all systems. You will need to use different approaches depending on the environment, and then most likely include a switch depending on the present

Executing GTK functions from other threads

人盡茶涼 提交于 2020-05-28 06:39:07
问题 This question is about GTK and threads. You may find it useful if your application crashes, freezes or you want to have a multithreaded GTK application. 回答1: Main Loop In order to understand GTK you must understand 2 concepts. All contemporary GUIs are single-threaded. They have a thread which processes events from window system (like button, mouse events). Such a thread is called main event loop or main loop. GTK is also single threaded and not MT-safe. This means, that you must not call any

Implementing overlapping shortcuts

一个人想着一个人 提交于 2020-05-17 07:44:32
问题 I'm trying to implement the Ctrl+C shortcut a widget without it disturbing other defined shortcuts. Problem My window looks like this: GtkWindow GtkEntry GtkToggleButton Part of the code // --- add checkbox --- GtkWidget * checkbutton = gtk_check_button_new_with_label("My Checkbox"); gtk_container_add(GTK_CONTAINER(vbox), GTK_WIDGET(checkbutton)); // --- setup checkbox shortcut --- GtkAccelGroup * accel_group = gtk_accel_group_new(); gtk_window_add_accel_group(GTK_WINDOW(window), accel_group)