gtk3

How to get native windows decorations on GTK3 on Windows 7+ and MSYS2

我与影子孤独终老i 提交于 2019-12-03 11:51:47
问题 I am trying to port my application from linux to windows and I have a problem with theming. In linux this works out of a box, just compile it and application is using good theme and looks native. I have installed gtkmm3 and gtk3 in MSYS2 and I am building it with CMake. This is OK, I had to copy all dlls to directory with binary to be able to execute it. I did not copy anything else. I am trying to create "unzip and execute" package. My problem is, that application looks out of place. It does

How to have drag-and-drop and sorted GtkTreeView in GTK3?

柔情痞子 提交于 2019-12-03 10:55:32
I am porting liblarch , a library for handling directed acyclic graphs, from PyGTK (GTK2) to PyGObject introspection (GTK3). I ran into the problem with GtkTreeView. The app using liblarch needs to sort GtkTreeView by a column but in the same time, the user can drag-and-drop rows, move a row under another row. For that I had to manually process dnd_data_get() and dnd_data_receive() which is perfectly okay. There is the minimal setup for GtkTreeView which works under PyGTK. Rows are sorted and the user can move rows around. #!/usr/bin/python # -*- coding: utf-8 -*- import gtk window = gtk

Can't import Webkit from gi.repository

*爱你&永不变心* 提交于 2019-12-03 09:04:53
问题 When I try to import Webkit from gi.repository , it gives an ImportError : from gi.repository import Webkit ERROR:root:Could not find any typelib for Webkit Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: cannot import name Webkit What am I doing wrong? 回答1: Your error seems a typo and the library is not found for that. You have to put "WebKit" instead of "Webkit". Additionaly if you use Ubuntu check the library existence with: $ locate girepository | grep

Use glade with pygobject Gtk3

风流意气都作罢 提交于 2019-12-03 05:49:13
I am converting a script to use Gtk3 using the migration guide ( Porting GTK2 to GTK3 ). I converted my import pygtk to a from gi.repository import Gtk and so on... I'm stuck because the glade module was loaded from module gtk: import gtk import gtk.glade but there's no way now to do that anymore. Note that I would only need a replacement for gtk.glade.XML() ... Well, the solution is pretty obvious, after calling to Gtk.Builder() one needs to convert the old glade interface with the gtk-builder-convert command to get the interface file in the right version. $ gtk-builder-convert myui.glade

How to get native windows decorations on GTK3 on Windows 7+ and MSYS2

天大地大妈咪最大 提交于 2019-12-03 02:19:00
I am trying to port my application from linux to windows and I have a problem with theming. In linux this works out of a box, just compile it and application is using good theme and looks native. I have installed gtkmm3 and gtk3 in MSYS2 and I am building it with CMake. This is OK, I had to copy all dlls to directory with binary to be able to execute it. I did not copy anything else. I am trying to create "unzip and execute" package. My problem is, that application looks out of place. It does not look native at all. There are shadows around the window, which is fine in Windows10, but in

PyGObject GTK+ 3 - Documentation?

怎甘沉沦 提交于 2019-12-03 02:01:56
问题 PyGObject appears to have no real documentation. This tutorial is as close as it gets. I've been struggling all morning simply trying to find a description of the arguments accepted by the Gtk.Window constructor. It seems I can't do much reflection in Python because everything in PyGObject is dynamically generated. All I want is to know what arguments I can pass to this constructor! There doesn't appear to be an equivalent of this object in the GTK+ 3 documentation, and reading the source

Can't import Webkit from gi.repository

百般思念 提交于 2019-12-02 23:08:38
When I try to import Webkit from gi.repository , it gives an ImportError : from gi.repository import Webkit ERROR:root:Could not find any typelib for Webkit Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: cannot import name Webkit What am I doing wrong? Your error seems a typo and the library is not found for that. You have to put "WebKit" instead of "Webkit". Additionaly if you use Ubuntu check the library existence with: $ locate girepository | grep WebKit /usr/lib/girepository-1.0/WebKit-3.0.typelib If doesn't exist you need install the package gir1.2

Is there a gi.repository documentation for python?

狂风中的少年 提交于 2019-12-02 18:49:24
I'm looking for a gi.repository module documentation and I can't find anything on the internet. All I found is documentation of new Gtk3 libraries for C, or old PyGtk 2.0 Reference Manual I'm looking for something like PyGtk 2.0 Reference Manual but for Gtk3. Is there something similar for Python? (I'm not looking for dir(Gtk) or help(Gtk) in the Python console.) I think you're looking for this . It's a work in progress, but basically is a tutorial for Gtk3 in python. I doesn't really cover any other thing aside from Gtk widgets (so no Glib, for example), but it's still useful to get started.

How do I cast Widget to Label in Haskell's GI-Gtk?

本小妞迷上赌 提交于 2019-12-02 18:32:02
问题 I have this sample code where I have a ListBox containing ListBoxRows, which in turn contain a Label. When I click on the ListBox, I get a ListBoxRow. So far so good. The problems start when I want to interact with the ListBoxRows children. I have used this function to get the Label, which is the child of the ListBoxRow. https://hackage.haskell.org/package/gi-gtk-3.0.18/docs/GI-Gtk-Objects-Container.html#g:13 However, the returned type is Widget. How do I convert the type of the object?

How do I change the mouse cursor over a GtkDrawingArea in GTK3?

你。 提交于 2019-12-02 16:19:37
问题 This follows from my previous question, I am trying to set the mouse cursor to cross hair when hovering over a GtkDrawingArea. I am trying to apply the answer from ebassi to the following code from zetcode. So far I have got: #include <cairo.h> #include <gtk/gtk.h> static void do_drawing(cairo_t *); struct { int count; double coordx[100]; double coordy[100]; } glob; static gboolean on_draw_event(GtkWidget *widget, cairo_t *cr, gpointer user_data) { do_drawing(cr); return FALSE; } static void