gdk

ubuntu : Sublime Text 3无法输入中文

痞子三分冷 提交于 2019-11-30 01:50:59
1).保存下面的代码到文件sublime_imfix.c(位于~目录) #include <gtk/gtkimcontext.h> void gtk_im_context_set_client_window (GtkIMContext *context, GdkWindow *window) { GtkIMContextClass *klass; g_return_if_fail (GTK_IS_IM_CONTEXT (context)); klass = GTK_IM_CONTEXT_GET_CLASS (context); if (klass->set_client_window) klass->set_client_window (context, window); g_object_set_data(G_OBJECT(context),"window",window); if(!GDK_IS_WINDOW (window)) return; int width = gdk_window_get_width(window); int height = gdk_window_get_height(window); if(width != 0 && height !=0) gtk_im_context_focus_in(context); } 安装 C/C++ 的编译环境和

Getting keyboard modifiers state using Gnome libs (GDK) fetches initial state only

痴心易碎 提交于 2019-11-29 11:33:34
I'm trying to get the current keyboard modifiers state through gnome GDK or GTK library in aim to implement an accessibility gnome shell extension that shows that state. I know how to get thier state using xlib, but there is not full binding for gnome gjs. The code below get only the initial state. It does not update state. /* * compiling: gcc `pkg-config --cflags gdk-3.0` -o gdk_mod gdk_mod.c `pkg-config --libs gdk-3.0` */ #include <gdk/gdk.h> int main (int argc, char **argv) { gdk_init(&argc, &argv); GdkDisplay * disp; disp = gdk_display_open(NULL); if (disp!=NULL) g_printf("display

GTK Window Cover Entire Screen

一世执手 提交于 2019-11-28 14:44:17
I'm working on a small educational piece of work, I create a window and its supposed to cover the entire monitor. However "special" areas are not being covered as seen in the screnshot at bottom. My window is a solid red with no menu bar scroll bar etc, is there anyway to make this cover the top menu bar and the dock. In my screenshot I am testing on Ubuntu and Mint, this is consistent behavior on Gtk OS's I need to be ablve ot set my window so it covers all things is this possible? I tried gdk_window_fullscreen but it's not doing anything, not even fullscreen, do you think its because I'm

save current window as image using gtk#

自古美人都是妖i 提交于 2019-11-28 10:31:43
问题 How can I save the current window as an image file such as a png? I know I can get a gdkWindow from current windows. I can even get an image. From this image struct I can even query each pixel. But from what I understand what I really need is to get a pixbuf. int width; int height; this.GetSize(width, height); this.GdkWindow.GetImage(0,0,width,height).? How do I get a pixbuf from a gtk window or a gdk window or a gdk image ? EDIT int width; int height; this.GetSize(out width, out height);

Difference between GtkWindow and GdkWindow?

江枫思渺然 提交于 2019-11-27 21:19:39
问题 At the beginning of my Gtk-Gdk-Cairo-Pango app, I create the window: GtkWidget *window = gtk_window_new(GTK_WINDOW_TOPLEVEL); First, there is GtkWindow , but gtk_create_window returns GtkWidget , not GtkWindow , why? Then, some functions, like gdk_window_process_updates(..) require GdkWindow* . gtk_window_set_geometry_hints() on the other hand requires GtkWindow* . In documentation there is also GdkWindow* gdk_window_new() that returns GdkWindow . Sure there is documentation saying: A

GTK3 and multithreading, replacing deprecated functions

喜欢而已 提交于 2019-11-27 15:09:51
问题 I would like to replace deprecated functions gdk_threads_enter()/leave() in my application that uses threads. The application as it is now, works perfect ( although i am not sure if this is the right way to do it ). My main loop, runs the gtk_main and the signal handlers. When i receive a start button, i start a thread, that runs in the background along the main. How can i update the GUI from that thread. I know per the Documentation of GTK3 and GDK3, they say avoid it by using gdk_threads

GTK Window Cover Entire Screen

陌路散爱 提交于 2019-11-27 08:48:58
问题 I'm working on a small educational piece of work, I create a window and its supposed to cover the entire monitor. However "special" areas are not being covered as seen in the screnshot at bottom. My window is a solid red with no menu bar scroll bar etc, is there anyway to make this cover the top menu bar and the dock. In my screenshot I am testing on Ubuntu and Mint, this is consistent behavior on Gtk OS's I need to be ablve ot set my window so it covers all things is this possible? I tried