gtk

How do you set an enum property on a GLib object?

半腔热情 提交于 2020-02-16 05:50:08
问题 I am trying to set the "ellipsize" enum property on a GtkCellRendererText object. I am trying to use g_object_set_property as follows: GtkCellRenderer *renderer = gtk_cell_renderer_text_new (); GValue val = G_VALUE_INIT; g_value_init (&val, G_TYPE_ENUM); g_value_set_enum (&val, PANGO_ELLIPSIZE_END); g_object_set_property (G_OBJECT(renderer), "ellipsize", &val); However, I get an error message at run time: (infog:27114): GLib-GObject-WARNING **: 12:24:29.848: ../../../../gobject/gvalue.c:188:

How do you set an enum property on a GLib object?

自闭症网瘾萝莉.ら 提交于 2020-02-16 05:49:28
问题 I am trying to set the "ellipsize" enum property on a GtkCellRendererText object. I am trying to use g_object_set_property as follows: GtkCellRenderer *renderer = gtk_cell_renderer_text_new (); GValue val = G_VALUE_INIT; g_value_init (&val, G_TYPE_ENUM); g_value_set_enum (&val, PANGO_ELLIPSIZE_END); g_object_set_property (G_OBJECT(renderer), "ellipsize", &val); However, I get an error message at run time: (infog:27114): GLib-GObject-WARNING **: 12:24:29.848: ../../../../gobject/gvalue.c:188:

【项目】【开源】【GTK】gtk编写项目卡片生成器界面-README(生成属于你的README文件带图案)

不羁的心 提交于 2020-02-08 16:28:21
gtk编写项目卡片生成器界面-README gtkcard.c /* ################################################ #...........................................#..# #...............#####......#....#..........#...# #....####...........##......#.##......######...# #..##..........#######......##.......#.....#...# #..##.........##....##......#........#.....#...# #...#####......##### ##.....#.........##### #..# ################################################ #...@author:GuoLeilei..........................# #...@company:personal..........................# #...@date:20200102.............................# #...@version:v1.0.........

centos 安装vmware 9.02 报 Failed to load module \"pk-gtk-module\" \"canberra-gtk-module\"

淺唱寂寞╮ 提交于 2020-02-07 17:55:42
http://www.linuxidc.com/Linux/2012-01/50944.htm 系统平台:RHEL6.1 X86 32bit 软件版本:VMware-Workstation-Full-8.0.0-471780.i386.bundle 说明:适用于其他平台,其他VMware-Workstation版本。安装完成后要运行虚拟机,需要先输入序列号。 1.首先到官网上下载最新的版本,下载到本地后赋予可执行的权限。 # chmod +x VMware-Workstation-Full-8.0.0-471780.i386.bundle 2.执行安装。虽然能够弹出图形的安装界面,但有如下的错误信息。 # ./VMware-Workstation-Full-8.0.0-471780.i386.bundle Extracting VMware Installer...done. Gtk-Message: Failed to load module "pk-gtk-module": libpk-gtk-module.so: cannot open shared object file: No such file or directory Gtk-Message: Failed to load module "canberra-gtk-module": libcanberra-gtk

Python : Get gtk.treeview selection from another widget

不羁岁月 提交于 2020-02-05 15:50:31
问题 It looks like the only way to get the selected item of a gtk.TreeView() is to actually click on it : tree_selection = self.treeview.get_selection() tree_selection.connect('changed', self.my_callback) self.treeview.connect('row-activated', self.my_other_callback) But what if I'm listing files in my treeview, and need a "file properties" menu item? Or a play button, that needs to access selected file to pass the filename to a player class / method ? Bonus question : How to call my_other

Asynchronously updating PyGTK tray icon

假装没事ソ 提交于 2020-02-05 05:57:25
问题 As explained here, I have a simple tray icon using PyGTK. Being very new to GTK, it appears to me that gtk.main() is synchronous, blocking any further processing until the respective UI is closed. So how can I periodically (e.g. every 5 seconds) update/refresh StatusIcon 's icon - do I have to resort to Twisted et al. for this? 回答1: You can use gobject.timeout_add() to add periodical tasks. The first parameter is the interval in seconds, the second parameter is the callback you want to be

Sphinx can't run 'make html'

|▌冷眼眸甩不掉的悲伤 提交于 2020-02-05 04:20:11
问题 I'm trying to create the documentation for my software by sphinx tool, so i've run sphinx-quickstart , and it's gone all ok. Then i have to run make html (inside doc folder just created) and i get an error . I don't know how to fix this error: Running Sphinx v1.2.2 loading pickled environment... not yet created building [html]: targets for 1 source files that are out of date updating environment: 1 added, 0 changed, 0 removed reading sources... [100%] index ** (sphinx-build:2390): WARNING **:

postgresql pgagent 的安装及使用

会有一股神秘感。 提交于 2020-02-04 14:54:20
pgagent 作为postgresql的一个任务调度代理,在postgresql 9.0 以前 是附带在pgadmin 包下面的,只是默认不安装,9.0之后作为了一个单独是的安装包。所以要使用 pgagent 定时任务调度的话还得单独安装。 在安装pgagent之前还需要安装另外的2个依赖包, cmake 以及 wxGTK . 这里我选择的软件版本分别是 postgresql 9.5.1 pgagent-3.4.0下载地址:https://www.pgadmin.org/download/pgagent.php cmake-2.8.5 下载地址:http://cmake.org/download/ wxGTK-2.8.12 下载地址:http://www.wxwidgets.org/downloads/ 一、postgresql 的安装 (略) 二、cmake的安装 将安装包上传至服务器并解压,解压后进入解压后生成的cmake-2.8.5目录,执行以下命令。 [root@lsrac97 ~]# tar zxvf pgagent-3.4.0.tar.gz [root@lsrac97 ~]# cd cmake-2.8.5 [root@lsrac97 cmake-2.8.5]# ./bootstrap && make && make install 三、wxGTK-2.8.12 的安装

gtk PyGObject示例1

[亡魂溺海] 提交于 2020-02-03 15:55:13
PyGObject入门 使用Gtk.Builder引入glade的UI文件 < ? xml version="1.0" encoding="UTF - 8" ? > < !-- Generated with glade 3.22.1 - - > <interface > <requires lib="gtk+" version="3.20"/ > <object class="GtkAccelGroup" id="accelgroup1"/ > <object class="GtkTextBuffer" id="textbuffer1" > <property name="text" translatable="yes" > hello world !</property> </object > <object class="GtkWindow" id="window1" > <property name="can_focus" > False</property > <property name="title" translatable="yes" > Hello World</property > <property name="default_width" > 800</property > <property name="default_height" > 600<

Cairo context and persistence?

时光怂恿深爱的人放手 提交于 2020-02-02 06:32:48
问题 I am just getting started using pycairo, and I ran into the following interesting error. The program I write creates a simple gtk window, draws a rectangle on it, and then has a callback to draw a random line on any kind of keyboard input. However, it seems that with each keyboard input, I have to create a new context, or I get an error at the moment the program receives first keyboard input (specifically, on the .stroke() line). Error is as follows, if it matters. 'BadDrawable (invalid