gtk

GTK - Retrieve multiple values from widgets on button press

回眸只為那壹抹淺笑 提交于 2020-03-25 12:34:01
问题 This is a follow up question to my previous question here: GTK Retrieve values from multiple widgets on button press I am still trying to solve the same issue, however have implemented suggestions from the previous question's responses. Here is my full code: #include <gtk/gtk.h> struct data { GtkEntry *hash; GtkWidget *hashType; }; static void queue_hash (GtkButton *button, gpointer user_data) { struct data *dataStruct = user_data; GtkEntry *hashWid = dataStruct->hash; GtkWidget *hashTypeWid

ubuntu eclipse 配置 gtk+2.0 库

大兔子大兔子 提交于 2020-03-07 19:52:07
前言 IDE是我们不得不脭的东西,vi/vim/emacs + make + gcc/g++的方式固然很牛X,也很高效,但是它们无一不是配置复杂,需要极长年月才可以用的很好,达到替代所有IDE的程度。 所以我的选择是: 使用eclipse写代码,gvim写Makefile,在shell命令行中编译,运行。 gtk安装: 可参考如下网址: http://www.cnblogs.com/niocai/archive/2011/07/15/2107472.html 为了以防万一,我把这篇文章抄了下来 一、安装 1、安装gcc/g++/gdb/make 等基本编程工具 sudo apt-get install build-essential 2、安装 libgtk2.0-dev libglib2.0-dev 等开发相关的库文件 sudo apt-get install gnome-core-devel 3、用于在编译GTK程序时自动找出头文件及库文件位置  sudo apt-get install pkg-config 4、安装 devhelp GTK文档查看程序 sudo apt-get install devhelp 5、安装 gtk/glib 的API参考手册及其它帮助文档 sudo apt-get install libglib2.0-doc libgtk2.0-doc 6

【构建】Manjaro Linux 上 Ambulant Open SMIL Player 成功构建

怎甘沉沦 提交于 2020-03-05 19:45:04
功夫不负有心人,自己魔改翻新后的 Ambulant Player 终于构建成功了。理论上把代码克隆下来然后运行 build.sh 就行。可能会缺 ed 等依赖,按照控制台输出提示补全就好。构建成功生成的二进制可执行文件位于 src/player_gtk/AmbulantPlayer_gtk 。2015年的老古董终于复活啦! 有点失望的是 Ambulant Player 的界面比 Garlic Player 复杂不了多少,但是整个过程学习到了FFmpeg API 的演变史。 来源: oschina 链接: https://my.oschina.net/baytars/blog/3188726

Mac OS X Lion 10.7.4上安装GTK+心得,兼谈如何解决fink的“could not determine XFree86 version number”错误。

一笑奈何 提交于 2020-03-01 02:02:43
作者: zyl910 。 折腾了好几天,终于在Mac OS X Lion 10.7.4上装好GTK+了。其中走了不少弯路,于是将经验教训总结了一下。 一、系统环境(OS X与XCode)   操作系统:Mac OS X Lion 10.7.4(11E53)   编程工具:Xcode 4.4.1(1448),并装好了它的“Command Line Tools”。   安装过程可参考这些帖子—— 在virtualbox上安装Mac OS X Lion 之 配置过程 http://www.crifan.com/install_mac_os_x_lion_on_virtualbox_config_process/ 给VirtualBox上的Mac Lion安装Xcode http://www.crifan.com/install_xcode_for_mac_on_virtualbox/ Mac OS X Lion下找不到GCC http://blog.csdn.net/qinjienj/article/details/7456193 二、尝试GTK+官网方法   对于mac系统,官网上主要是以下这几个页面—— Download for Mac OS X http://www.gtk.org/download/macos.php Building GTK-OSX https://live

member function as callback function to g_signal_connect

二次信任 提交于 2020-02-28 06:28:44
问题 I have created a simple class for creating gtk main window. I want to know what is correct way to pass class member function as an argument to G_CALLBACK function? Why g_signal_connect(button, "clicked", G_CALLBACK(&MainWindow: nButtonClicked), NULL); is bad? #include <gtk/gtk.h> class MainWindow { public: MainWindow(); ~MainWindow(); void onButtonClicked(GtkWidget* button, gpointer* data); void showWindow(); private: GtkWidget* window; GtkWidget* button; }; MainWindow::MainWindow() { window

member function as callback function to g_signal_connect

ⅰ亾dé卋堺 提交于 2020-02-28 06:28:39
问题 I have created a simple class for creating gtk main window. I want to know what is correct way to pass class member function as an argument to G_CALLBACK function? Why g_signal_connect(button, "clicked", G_CALLBACK(&MainWindow: nButtonClicked), NULL); is bad? #include <gtk/gtk.h> class MainWindow { public: MainWindow(); ~MainWindow(); void onButtonClicked(GtkWidget* button, gpointer* data); void showWindow(); private: GtkWidget* window; GtkWidget* button; }; MainWindow::MainWindow() { window

Python:桌面气泡提示功能实现

守給你的承諾、 提交于 2020-02-27 09:39:10
在写桌面软件时,通常会使用到托盘上的泡泡提示功能,让我们来看看使用python如何实现这个小功能。 一、Linux系统: 在Linux上,实现一个气泡提示非常简单,使用GTK实现的pynotify模块提供了些功能,我的环境是Ubuntu,默认安装此模块,如果没有,可从 http://home.gna.org/py-notify/ 下载源文件编译安装一个。实现代码如下: #!/usr/bin/python #coding:utf-8 import pynotify pynotify.init ("Bubble@Linux") bubble_notify = pynotify.Notification ("Linux上的泡泡提示", "看,比Windows上实现方便多了!") bubble_notify.show () 效果: 二、Windows下的实现。 Windows下实现是比较复杂的,没有pynotify这样一个模块,找到了一个还算不错的模块(地址: https://github.com/woodenbrick/gtkPopupNotify ,这个类有些语法上的小问题,至少在python2.6下如此,需要修改一下,如下是修改后的代码),基本可用,代码如下: #!/usr/bin/env python # -*- coding: utf-8 -*- #gtkPopupNotify

Gtk+ Tutorials & Resources

心已入冬 提交于 2020-02-25 10:01:18
Welcome to Gtk+ Tutorials & Resources. This page is a collection of information (Documentation, Tutorials, Examples) for Gtk+ programmers. Not everything is Gtk specific but everything here can be utilized to develop different types of Gtk programs. Note: All of these books/tutorials focus on the c programming language. Note: What needs to be done this week. 1. List needs to be reorganized, updated, redesigned "Starting to look like a mess" also all tutorials and references need to be backed-up. Since i started this list we have lost a total of 5 tutorials due to sites being taken down. Thank

How do I change the colors of an arbitrary widget in GTK+?

泪湿孤枕 提交于 2020-02-20 10:02:34
问题 If I'm writing an application that wants to communicate some information through the use of color, how can I change the background and foreground colors of a given widget? I would like to know how to do this in glade if it's possible, as well as programmatically (to a computed color). I want to know how to do this to a complex widget as well, for example, an HBox that contains a VBox that contains some Labels . Ideally this would also include a solution solution that allows me to tint the

ubuntu 10.04编译webkit gtk过程

人盡茶涼 提交于 2020-02-16 11:41:35
这天工作上没什么安排,打算研究下webkit,从 http://nightly.webkit.org/builds/trunk/src/1 下载到webkit源码进行编译,没想到遇到不少问题,还把虚拟机的里ubuntu系统启动不了,最终落得重温重装ubuntu系统。以下是编译 webkit过程遇到的种种不良的情况,希望对编译webkit的盆友有所帮助。 我的环境:32位ubuntu 10.04,联想Y470。 一、webkit 介绍 WebKit是Mac OS X v10.3及以上版本所包含的软件框架。同时,WebKit也是Mac OS X的Safari网页浏览器的基础。WebKit是一个开源项目,主要由KDE的KHTML修改而来并且包含了一些来自苹果公司的一些组件。 WebKit包含一个网页引擎WebCore和一个脚本引擎JavaScriptCore,它们分别对应的是KDE的KHTML和KJS。不过,随着JavaScript引擎的独立性越来越强,现在WebKit和WebCore已经基本上混用不分(例如Google Chrome采用V8引擎,却仍然宣称自己是WebKit内核)。当初苹果公司在设计WebKit之时加入了太多Mac OS X平台的独有事物,这给向其它系统的移植造成了很大障碍。不过,由于WebKit出色的开源特性,这些障碍正在被不断克服