is GTK 3.x a real cross-platform solution?

I have tasted both Qt 4.x/5.x and GTKmm 3.x and I really like GTKmm over Qt. Now I have just discovered that GTKmm 3.x doesn't offer a Windows porting, they also do not offer a Mac porting,...

How to use a custom font in a GTK app

I have a font file /path/to/app/fonts/custom-font.ttf and I want to use it. How do you import a custom TTF for use in a GTK+3.0 app? from gi.repository import Gtk, Pango # ... lbl =...

Is there a manual/list of special Gtk CSS properties?

I'm trying to redesign some Gtk3 widgets in my application (like scrollbars or paned) but was unable to set borders and other properties for paned specifically. I then found some CSS data in...

Asyncio calls running in Gtk main loop

Okey guys question concerning asyncio and Gtk+. How can I run code below in Gtk.main loop ? I searched for example but couldn't find any. #!/usr/bin/python3.4 import...

Trouble hiding and showing widgets in response to event

Problem I have a problem where closing a widget with the delete event, via gtk_widget_hide_on_delete fails to show the menu widget again via a swapped gtk_widget_show_all with the corresponding...

How can I get pixels from cairo.ImageSurface?

I made a Python program that draws a black rectangle with a white circle inside it when I click on a button. I use Gtk.DrawingArea and cairo.ImageSurface. The code is the following. class App: ...

GTK3 window transparent

Is there a way or a hack to create a GTK+3 transparent window without a composition manager in Linux? I want a GtkWindow invisible (zero alpha) with visible childs objects. I've...

Why Accelerator Key does not show up on Gtk.Application menu?

The following python Gtk application code is working perfectly in terms of showing one simple menu. That menu can be activated using short-cut key (aka accelerator/accel). But the key doesn't show...

How does one add an item to GTK's "recently used" file list from Python?

I'm trying to add to the "recently used" files list from Python 3 on Ubuntu. I am able to successfully read the recently used file list like this: from gi.repository import Gtk recent_mgr =...

Get the selected text from GTK3 ComboBox in C

I'm only starting to learn GTK3, but I'm having a real struggle. All of the documentation that i could find is for GTK2 and the gnome dev web site is simply not good enough. Now I am trying to...

GTK How to set font for a text_view

How can I set the font name and size for a text_view? Or do I have to set the font information at the buffer or at the window? Do I have to create some sort of style-sheet? #include...

Is recent GTK 3.22 still Boehm GC friendly (thread issue)?

The Boehm's conservative garbage collector is quite useful (e.g. Bigloo is using it, Guile is using something similar, etc....), notably on Linux (which is the only OS I care about; I'm using...

Where is the cairo context object cr declared?

Where, in the following zetcode, is the cairo context *cr* declared? #include <cairo.h> #include <gtk/gtk.h> static void do_drawing(cairo_t *); struct { int count; double coordx[100]; ...

GTK 3.0 Evolution css theme gtk.css

I have looked all over the place and can't seem to find the CSS ID's for Evolution.. I want to be able to customize the colors in Evolution. I have found some CSS tags that were changing sizes but...

how to style gtk widgets individually with css code

After this https://stackoverflow.com/questions/47083294/gtk-change-font-to-spin-button and this https://stackoverflow.com/questions/47114306/how-to-apply-css-to-gtk-code question, I started...

Python Gtk3 - Scroll TextView inside of ScrolledWindow by mouse and courser position

I have some text in a Gtk.TextView When I select the text with my mouse or navigate the cursor beyond the bottom edge I cannot se my selection because it does not scroll. So I think I need to get...

Installing GTK for use in Code::Blocks on Windows 10

Original Question I am having trouble installing gtk to start building GUIs in C++ on Code::Blocks. Could anyone nudge me in the right direction? I'm running Windows 10 (64-bit) on a Lenovo. I...

GTK3 Detect user resizing window

This is some example code from the Gnome website: #include <gtk/gtk.h> static void resizechange() { printf("User resized window!\n"); } static void activate (GApplication *app, ...

ERROR: ld.so: object 'libgtk3-nocsd.so.0' from LD_PRELOAD cannot be preloaded

Running into this issue when working with Hugo and the AWS CLI on Ubuntu 18.04. ERROR: ld.so: object 'libgtk3-nocsd.so.0' from LD_PRELOAD cannot be preloaded (failed to map segment from shared...

Executing GTK functions from other threads

This question is about GTK and threads. You may find it useful if your application crashes, freezes or you want to have a multithreaded GTK application.

Does PyGobject have any reference books?

I'm trying to learn pygobject but could find any books. The reference manual in https://lazka.github.io/pgi-docs/#Gtk-3.0/classes/Window.html#Gtk.Window has syntax but no examples. is there a way...

OSError: cannot load library 'gobject-2.0': error 0x7e

I installed the package weasyprint according to the instructions Installing weasyprint (Django project). My system: win 10. I have installed gtk3 and it is present in my PATH import...

Why is it not available in CentOS wx.html2 . WebView control´╝č

I use wxpthon library to write UI program in CentOS system wx.html2 . WebView control, the following error is prompted: File "main.py", line 143, in <module> frame = DemoFrame() File...

VS Code C/C++ configuration for GTK development

I am trying to set up a friendly environment for C/C++ programming in VS Code on Linux Ubuntu. For years I've been using Visual Studio and Code Blocks, however VS Code set up is so unclear that I...

Ubuntu Python Playsound error 'NoneType' object has no attribute 'props'

I can't use the playsound on Linux for some reason, I tried: sudo apt install gstreamer1.0-gtk3 But still not working. The code is pretty simple: import os import time import playsound import...

How do I implement a drag and drop system in a Gtk TreeView?

I am teaching myself Python Gtk+3 using the readthedocs tutorial. I'm currently working on drag and drop and want to create a TreeView where every line is dragable. To do this, my code reads in a...

how to solve weasyprint error message gobject-2.0-0 error 0x7e message?

I installed several files based upon `https://pbpython.com/pdf-reports.htm to create reports. However the following error messages Traceback (most recent call last): File...

GTK - Python Window Symbolic Icon Color Problem

I have a GTK3 GUI called by a simple Python 3 code. Icon is located in the /usr/share/icons/hicolor/scalable/actions/ directory. My current theme color is dark and icons look white. When I switch...

How do you do 3D rendering in Gtk+ using OpenGL?

I've been searching around the internet a lot for a way to use 3D graphics inside my Gtk application and I have found Gtk Glarea, but I can't find any tutorials. Does anyone have any recommendations?

GTK-Python Application Two Separate Processes

I have a simple Python 3 application and it uses GTK3 GUI. The application has an application ID and two separate processes are started when the application is started: 1) Main.py 2) test1 What...