gtk3

Set window gravity in PyGObject?

北战南征 提交于 2019-12-11 05:05:43
问题 Every time I try to set the gravity of my application, it keeps throwing an error message like this: AttributeError: 'gi.repository.Gdk' object has no attribute 'GRAVITY_SOUTH_EAST' What is the correct method for setting the gravity of a GTK3 application with python? (Not pygtk, I'm using the newer PyGI libraries.) There isn't a documentation for PyGI AFAIK, and when I do help(Gdk.Gravity) in the python console it returns GDK_GRAVITY_SOUTH_EAST as an option. 来源: https://stackoverflow.com

Implementation of gtk3's new Height-for-width Geometry Management method

不打扰是莪最后的温柔 提交于 2019-12-11 04:55:35
问题 In continuation of my previous question Drag and drop on a fixed container changes its size I followed the advice given from ergosys and read the info in the link he provided. If I understood correctly, the new way of declaring /* LEFT FRAME */ frame1= gtk_frame_new(NULL); gtk_table_attach(GTK_TABLE(table), frame1, 0,14,0,49,GTK_SHRINK,GTK_SHRINK,0,0); gtk_widget_set_size_request(frame1, 360,570); is (ignore the height for the time being) static void my_widget_get_preferred_width (GtkWidget

GTK3 reuse CSS state background colors

别等时光非礼了梦想. 提交于 2019-12-11 04:49:47
问题 I am porting a PyGTK2 app. This app does things like this: self.normal_color = editor.style.base [Gtk.STATE_NORMAL] self.insensitive_color = editor.style.base [Gtk.STATE_INSENSITIVE] And sets it afterwards: if editable: self.editor.modify_base (Gtk.STATE_NORMAL, self.normal_color) else: self.editor.modify_base (Gtk.STATE_NORMAL, self.insensitive_color) self.editor is a GtkTextView . The reason why it does not just set it to editor.set_sensitive(False) is because the user programs in the

Precision timing of GDK3/GTK3 window update

北慕城南 提交于 2019-12-11 03:21:50
问题 I have an application written in C using GTK (although the language is probably unimportant for this question). This application has a fullscreen gtk_window with a single gtk_drawing_area . For the drawing area, I have registered a tick callback via gtk_widget_add_tick_callback which just calls gtk_widget_queue_draw every tick. Inside the drawing area draw callback, I change the color of the entire window at regular intervals (e.g., from black to white at 1Hz). Say that in this call to the

Gtk3 with Python, TextView rising multiple 'mark-set' signals

谁说我不能喝 提交于 2019-12-11 00:25:39
问题 Consider the following example code, which puts a TextView inside a window and registers the mark-set event: #!/usr/bin/env python3 from gi.repository import Gtk win = Gtk.Window(title='test') text_view = Gtk.TextView() def test (*args): print('test!') win.add(text_view) text_view.get_buffer().connect('mark-set', test) win.connect('delete-event', Gtk.main_quit) win.show_all() Gtk.main() If I launch it, and I click on the visualized TextView once I get the debug output multiple times: $ ./test

How do I really make a GTK+ 3 GtkLayout transparent/draw theme background?

眉间皱痕 提交于 2019-12-10 19:33:34
问题 If I create a normal GtkWindow with nothing inside or a GtkWindow with a GtkDrawingArea inside (or that inside a GtkScrolledWindow), I get a window with the theme's background, as in this picture. But if I use a GtkLayout, I get a window with a solid color background, as in this picture. The only resource anyone (myself included) could find so far was this other Stack Overflow question, but when I do what it says to do, I get a fully black background, like in this picture, even if I get a

Python 3 and Gtk+3 - issue with TreeView and alternate colors of rows

帅比萌擦擦* 提交于 2019-12-10 17:42:18
问题 Hello I'm new in python and Gtk+3 development. I'm trying to create a Gui with Gtk+3 which contains a Gtk.TreeView. I'm trying to show the odd records of the TreeView in different color but i always fail. I search all over the internet and StackOverFlow but i didn't find something helpful. So i beg you for help. i.m using Python 3.4.3. Thanks in advance! #!/usr/bin/env python3 # -*- coding: ISO-8859-1 -*- import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk, Gdk xim = [(

Setting a single row of a CellRendererToggle to inconsistent

谁说胖子不能爱 提交于 2019-12-10 17:34:41
问题 On Gtk+3, I'm using a TreeModel to store nested information and I display it with a CellRendererText and a CellRendererToggle . The user can clic on every toggle button, and when there are nested ones and they are not in the same state, I want the ones of upper level to reflect the 'inconsistent' state. How can I set this property for one element ? For more clarity, an example of what I want to achieve from the Transmission bittorrent client : I know how to set all the buttons of the cell

Gtk-ERROR **: GTK+ 2.x symbols detected

自古美人都是妖i 提交于 2019-12-10 16:15:52
问题 I'm compiling my c application with gcc with the following flags: gcc evis.c `pkg-config --cflags --libs gtk+-2.0 --libs clutter-gtk-1.0 --libs gthread-2.0` -Wall -o evis Now my code compiles with a few warnings but still finishes. When I try to run my program I get: (evis:1820): Gtk-ERROR **: GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported How do I troubleshoot this error? How do I know where to look? Is there some kind of tool I could use online

Get the window handle in PyGI on MacOS

馋奶兔 提交于 2019-12-10 15:28:48
问题 I use PyGObject/PyGI and GStreamer to show a video in my GUI. The video is shown in a Gtk.DrawingArea and therefore I need to get it's window-handle in the realize-signal-handler. On Linux I can simply use drawing_area.get_property('window').get_xid() and on Windows I have to access the C-API (like described here): drawingarea_window = drawingarea.get_property('window') ctypes.pythonapi.PyCapsule_GetPointer.restype = ctypes.c_void_p ctypes.pythonapi.PyCapsule_GetPointer.argtypes = [ctypes.py