gtk

How do I use GTK and glut together?

我的未来我决定 提交于 2019-12-22 09:23:31
问题 I know that in order to write a GTK application, I write a bunch of code which describes what is put in the main window, then I call: gtk_main(); Any code statements after this do not get executed. Now let's suppose I'd like my GTK app to display something I wrote with glut, which itself contains a bunch of statements about what graphics need to be set etc. then ends with the statement: glutMainLoop(); Anything after this is not executed. So my problem is that either of these two statements

Scrolling a WebKit2.Webkit window in GTK+3

▼魔方 西西 提交于 2019-12-22 08:24:07
问题 How does one scroll a webkit2gtk widget? In webkitgtk (aka. webkit1 ) you wrap your WebView in a ScrolledWindow , so can use its vadjustment property. For wekit2gtk , this call on the WebView just returns None , and I see no other method to call. As an explanation, I want to add touch support to webkit2 . I have hacked my way into this by adding a transparent layer over the WebView widget ¹, but now I'm detecting touches I seem unable to use them. ¹ A release that came out today has removed

How can I setup LookAndFeel Files in Java?

霸气de小男生 提交于 2019-12-22 07:51:09
问题 I need to setup LookAndFeel Files in JDK 1.6. I have two files: napkinlaf-swingset2.jar napkinlaf.jar How can I set this up and use it? I would like a GTK look and feel OR Qt look and feel, Are they available? 回答1: The class name for Naplin is net.sourceforge.napkinlaf.NapkinLookAndFeel . So to set it as default on the command line, use: java -Dswing.defaultlaf=net.sourceforge.napkinlaf.NapkinLookAndFeel To install it add napkinlaf.jar to the lib/ext direction and the lines: swing

gtk minimum size

倖福魔咒の 提交于 2019-12-22 06:47:31
问题 Is there an easy way to request that a GTK widget have a minimum width/height? I know you can do it on the column of a TreeView , but is it available for general widgets? 回答1: For C/C++: gtk_widget_set_size_request() Sets the minimum size of a widget; that is, the widget's size request will be width by height. PyGTK: def set_size_request(width, height) 来源: https://stackoverflow.com/questions/3916762/gtk-minimum-size

Which GTK+ elements support which CSS properties?

女生的网名这么多〃 提交于 2019-12-22 06:35:31
问题 While applying my own CSS to my GTK+ application, I noticed, that some elements ignore some CSS properties and others ignore others or don't ignore them, which leads me to search for an overview of which elements support which CSS properties. So far I couldn't find any such overview. For example Gtk.Label doesn't support border at all, I had to put a Gtk.Frame around it and style that in the CSS file. Another issue is, that even a Gtk.Frame doesn't support margin , which I want to use. Can

Enter-Notify-Event Signal not working on gtk.ToolButton

半腔热情 提交于 2019-12-22 06:01:10
问题 On a happy (if not irrevelent) note, this is the absolute last obstacle in this particular project. If I fix this, I have my first significant dot release (1.0), and the project will be going public. Thanks to everyone here on SO for helping me through this project, and my other two (the answers help across the board, as they should). Now, to the actual question... I have a toolbar in my application (Python 2.7, PyGTK) which has a number of gtk.ToolButton objects on it. These function just

How can I find out where is my code causing GLib-GObject-CRITICAL?

别来无恙 提交于 2019-12-22 05:59:38
问题 When a C/C++ application fails with the following CRITICAL, can you please tell me how can I find out where is the code causing the error? I have tried to run it in the debugger, trying to do a 'bt when the program fails. But it does not show where is the code causing the CRITICAL: (process:3155): GLib-GObject-CRITICAL **: /build/buildd/glib2.0-2.22.3/gobject/gtype.c:2458: initialization assertion failed, use IA__g_type_init() prior to this function (process:3155): GLib-CRITICAL **: g_once

Can you get the parent GTK window from a widget?

强颜欢笑 提交于 2019-12-22 03:49:05
问题 I have a custom widget and it needs to launch a MessageDialog and in order for me to put that message dialog on top of the window my widget is in then I need access to the parent gtk.window. Is there a way to get the parent GTK window? Thanks 回答1: The GTK docs suggest: GtkWidget *toplevel = gtk_widget_get_toplevel (widget); if (gtk_widget_is_toplevel (toplevel)) { /* Perform action on toplevel. */ } get_toplevel will return the topmost widget you're inside, whether or not it's a window, thus

Authenticating GTK app to run with root permissions

浪子不回头ぞ 提交于 2019-12-22 03:26:08
问题 I have a UI app (uses GTK) for Linux that requires to be run as root (it reads and writes /dev/sd*). Instead of requiring the user to open a root shell or use "sudo" manually every time when he launches my app, I wonder if the app can use some OS-provided API to get root permissions. (Note: gtk app's can't use "setuid" mode, so that's not an option here.) The advantage here would be an easier workflow: The user could, from his default user account, double click my app from the desktop instead

Gtk3 label line spacing

可紊 提交于 2019-12-22 00:35:20
问题 Is there any way to specify spacing between lines of text in multiline Gtk3 Label, as with CSS line-height property? This CSS property does not work and I can't google out anything else. 回答1: I found the solution using Pangoattribute on label <br>PangoAttrList *attr_list;</br> <br>PangoAttribute *attr;</br> <br> attr_list=pango_attr_list_new();</br> <br>attr=pango_attr_rise_new (20000);</br> <br>pango_attr_list_insert(attr_list,attr);</br> <br>gtk_label_set_attributes(GTK_LABEL(label),attr