gtk

Drawing lines with GTK+ and Cairo without removing what is already drawn

╄→гoц情女王★ 提交于 2020-05-31 06:54:40
问题 Currently I am writing a program in C, on a linux system (Raspberry Pi to be exact) which should draw to a GTK window using Cairo. I've been following the tutorial at: http://zetcode.com/gfx/cairo/ . But it is way to vague with it's explanations at certain points. It does not explain two points that I really need: I can't figure out a way to draw to the window with a proper function call. It removes what is already drawn. I need a piece of code that does some simple things, in a very Object

Shipping PyGObject/GTK+ app on Windows with MingW

对着背影说爱祢 提交于 2020-05-17 06:09:09
问题 I'm using PyGObject/GTK+ with Python3.7 on Windows and is worried about how to package my app. With official Python ecosystem, it's easy to use freezers and venvs. However, the PyGObject and GTK+ on Windows requires the MingW environment to run. Does this mean that I have to package the entire MingW, along with GTK+? How should I freeze the app? 回答1: Since no one cares soon enough, I'll report my findings here. The short answer, as of the date I write this post, is: The PyGObject eco-system

How to use g_timeout_add?

随声附和 提交于 2020-05-15 11:06:22
问题 I am making a program in C with GTK and Glade for a serial communication. I am having problem using g_timeout_add. For example I have a function serial_data() which contain my serial data and I have a button handler on_update_button_clicked() . So till now I have done that if update button is clicked, gtk_timeout should run. But it running just for one time. on_update_button_clicked(GtkButton *Update_Button) { //2nd argument is serial_data function which contain actual data g_timeout_add(250

How to build a GTK+3 program on Windows without MSYS2?

偶尔善良 提交于 2020-05-15 02:52:58
问题 I want to compile a code in GTK+3. Without using MSYS2 nor Visual Studio. I'm getting "undefined reference to" First, tried with this tutorial from the official page: https://www.gtk.org/download/windows.php but it was a mess using MSYS2; plus, i dont want a linux like nor a unix like environment (a lot less Visual Studio). I downloaded the "all in one bundle" for version 2, setted up the enviroment variable an all that stuff. Everything worked fine, the code compiled! (a code from version 2)

How to build a GTK+3 program on Windows without MSYS2?

人盡茶涼 提交于 2020-05-15 02:52:05
问题 I want to compile a code in GTK+3. Without using MSYS2 nor Visual Studio. I'm getting "undefined reference to" First, tried with this tutorial from the official page: https://www.gtk.org/download/windows.php but it was a mess using MSYS2; plus, i dont want a linux like nor a unix like environment (a lot less Visual Studio). I downloaded the "all in one bundle" for version 2, setted up the enviroment variable an all that stuff. Everything worked fine, the code compiled! (a code from version 2)

使用IDEA搭建Java源码分析环境

≡放荡痞女 提交于 2020-04-03 21:11:57
系统环境 版本: JDK1.8.0_211 创建Java项目 使用IDEA新建Java项目; 将源码文件 src.zip 解压到新建项目的 src 目录下; 移除项目与 Java 安装目录下源码压缩文件的关联,在 Project Structure 的 SDKs 中创建一个新的 JDK ,仍然使用 Java 安装目录的 Classpath ,但要将 Sourecepath 中的 src.zip 修改为项目中的 source 目录。 在 Project Structure 的 Modules 的 Dependencies 中,将 Module SDK 改为新创建的 JDK ; 创建 Main 类,包含 main 方法即可。 运行Main类中main方法 运行发现以下问题: 系统资源不足,抛出 OutOfMemoryError ; 程序包 UNIXToolkit 和 FontConfigManager 不存在; 找不到 com.sun.tools.xx 等类。 解决方案 针对资源不足问题,在 Settings -> Build, Excution, Deployment -> Compiler 中修改 Build process heap size 为 1200 即可。 程序包不存在,需要在 OpenJDK 找到与当前版本对应的这两个 .java 文件,在项目的源代码目录下创建 sun

Ubuntu16安装GTK+2.0教程

给你一囗甜甜゛ 提交于 2020-03-31 10:02:12
Ubuntu16安装GTK+2.0教程 Step 1 修改清华源(修改完可提高下载速度) 先运行 sudo gedit /etc/apt/sources.list 替换文本内容,保存,退出。 # 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释 deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports

Import CSS file in Python GTK3 program created using Glade

≯℡__Kan透↙ 提交于 2020-03-25 18:44:05
问题 I try to find information about adding a colored button widget. I tried adding suggested-action as class, but the button is still grey. So i want to write my own css file with my own style information. I'm using glade to create the glade file and build the gui from that in my main.py. Where do I have to put the css file in my source tree and how do I import it? 回答1: There is a HowDoI guide here: https://wiki.gnome.org/HowDoI/CustomStyle In Python you have to first import Gdk: gi.require

GTK Retrieve values from multiple widgets on button press

巧了我就是萌 提交于 2020-03-25 16:50:20
问题 I'm trying to retrieve a value from both an Entry field and a ComboBox in my window on a button press. I'm currently struggling to do so. I've been told that in order to get multiple value, I need to use structs. However I'm struggling to get it to work. Here is what I have so far: Function to be run on button press: struct data { GtkWidget *hash; GtkWidget *hashType; }; static void queue_hash (struct data *dataStruct) { GtkWidget *hashWid = dataStruct->hash; GtkWidget *hashTypeWid =

GTK Retrieve values from multiple widgets on button press

吃可爱长大的小学妹 提交于 2020-03-25 16:48:11
问题 I'm trying to retrieve a value from both an Entry field and a ComboBox in my window on a button press. I'm currently struggling to do so. I've been told that in order to get multiple value, I need to use structs. However I'm struggling to get it to work. Here is what I have so far: Function to be run on button press: struct data { GtkWidget *hash; GtkWidget *hashType; }; static void queue_hash (struct data *dataStruct) { GtkWidget *hashWid = dataStruct->hash; GtkWidget *hashTypeWid =