gtk2

How to create a cairo_t on a Gtk 2 window

独自空忆成欢 提交于 2019-12-01 07:17:01
问题 I have an old app, now compiling on Gtk 2, but I need to introduce the use of Cairo. I can't figure out how to create the necessary cairo context (cairo_t) from my Widgets. Here's the code I'm trying to learn with so far, modified (*ahem* cribbed) from a Gtk 3 tutorial. The crux of the matter is creating a cairo surface from the window widget. As it stands, that call is a sketch and it won't compile, let alone run. Remember, my target is Gtk2, not 3, at least at this point. /* Snitched from

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);

How to insert synthetic mouse events into X11 input queue

非 Y 不嫁゛ 提交于 2019-11-28 09:14:56
I've got an embedded device running Linux/X11 that is connected to a device that provides touch events over a USB connection. This device is not recognized as any form of standard pointer/mouse input. What I'm trying to do is find a way to "inject" mouse events into X11 when the external device reports an event. Doing so would remove the need for my application ( written in C using Gtk+ ) to fake mouse presses with Gtk+ calls. If this can be done my Gtk+ application would not need to know or care about the device generating the touch events. It would just appear to the application as standard

Can we ape the GTK+ 2.0 button style in Java Swing?

*爱你&永不变心* 提交于 2019-11-27 16:22:34
The problem with Java Swing is the look and feels (Metal, Nimbus, GTK...), the worst out there compared to SWT, Windows, Mac and Gnome Tool Kit, and getting good looking widgets is utopist, yet I am asking the question though. I need to know if there is a possibility to tweak a JButton to look like a default GTK button. Otherwise, can we give the JButton text a style (a shadow for example)? public class myTweakedButton extends JButton { // Override style attributes here. } Here is the style applied by GTK to the button widget: style "button" { xthickness = 3 ythickness = 3 bg[NORMAL] = shade

How do I link gtk library more easily with cmake in windows?

断了今生、忘了曾经 提交于 2019-11-27 15:25:31
I'm now doing it in a very ugly way by manually including all the required path(the gtk bundle is at D:/Tools/gtk+-bundle_2.20.0-20100406_win32 ): include_directories(D:/Tools/gtk+-bundle_2.20.0-20100406_win32/include/gtk-2.0 D:/Tools/gtk+-bundle_2.20.0-20100406_win32/include/glib-2.0 D:/Tools/gtk+-bundle_2.20.0-20100406_win32/lib/glib-2.0/include D:/Tools/gtk+-bundle_2.20.0-20100406_win32/include/cairo D:/Tools/gtk+-bundle_2.20.0-20100406_win32/include/pango-1.0 D:/Tools/gtk+-bundle_2.20.0-20100406_win32/lib/gtk-2.0/include D:/Tools/gtk+-bundle_2.20.0-20100406_win32/include/atk-1.0) link

How to insert synthetic mouse events into X11 input queue

佐手、 提交于 2019-11-27 02:46:39
问题 I've got an embedded device running Linux/X11 that is connected to a device that provides touch events over a USB connection. This device is not recognized as any form of standard pointer/mouse input. What I'm trying to do is find a way to "inject" mouse events into X11 when the external device reports an event. Doing so would remove the need for my application ( written in C using Gtk+ ) to fake mouse presses with Gtk+ calls. If this can be done my Gtk+ application would not need to know or

Can we ape the GTK+ 2.0 button style in Java Swing?

ぃ、小莉子 提交于 2019-11-26 18:36:47
问题 The problem with Java Swing is the look and feels (Metal, Nimbus, GTK...), the worst out there compared to SWT, Windows, Mac and Gnome Tool Kit, and getting good looking widgets is utopist, yet I am asking the question though. I need to know if there is a possibility to tweak a JButton to look like a default GTK button. Otherwise, can we give the JButton text a style (a shadow for example)? public class myTweakedButton extends JButton { // Override style attributes here. } Here is the style

How do I link gtk library more easily with cmake in windows?

拟墨画扇 提交于 2019-11-26 18:30:18
问题 I'm now doing it in a very ugly way by manually including all the required path(the gtk bundle is at D:/Tools/gtk+-bundle_2.20.0-20100406_win32 ): include_directories(D:/Tools/gtk+-bundle_2.20.0-20100406_win32/include/gtk-2.0 D:/Tools/gtk+-bundle_2.20.0-20100406_win32/include/glib-2.0 D:/Tools/gtk+-bundle_2.20.0-20100406_win32/lib/glib-2.0/include D:/Tools/gtk+-bundle_2.20.0-20100406_win32/include/cairo D:/Tools/gtk+-bundle_2.20.0-20100406_win32/include/pango-1.0 D:/Tools/gtk+-bundle_2.20.0