《GTK+/GNOME程序设计》 笔记

2016.05.13 笔记

GTK+简介

GTK 最初为GIMP(一个图像处理软件,类似Photoshop)的工具包
后来GTK重写为面向对象的GTK+

GTK+ 并非是用C++写的,而是用C语言,所谓的面向对象是用C语言模拟的。强大

GTK+ 2.0 新特性:
使用Pango(a theme engine)增强了文本渲染
improved accessibility using the Accessibility Toolkit, transition to Unicode using UTF-8 strings, and a more flexible API.

GTK+ 2.8, GTK+ 2 depends on the Cairo graphics library for rendering vector graphics.

GTK+ 3.0
included revised input device handling, support for themes written with CSS-like syntax, and the ability to receive information about other opened GTK+ applications.

版本的新特性参考 wiki GTK+

编译

GTK+ 3.0的编译选项,用法见下文:
pkg-config --cflags gtk+-3.0
pkg-config --libs gtk+-3.0
https://developer.gnome.org/gtk3/stable/gtk-getting-started.html

fedora Linux中安装gtk+/gnome开发包:
dnf install gnome-devel
dnf install gtk3-devel
dnf install gtk2-devel
dnf install gtk+-devel
dnf install gcc
dnf install gcc-c++

#include <gtk/gtk.h>
void CloseRequest(GtkWidget* theWindow, gpointer data);

gint main(gint argc, gchar* argv[])
{
   
   
  GtkWidget* window;
  
  gtk_init(&argc, &argv);
  window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
  gtk_signal_connect(GTK_OBJECT(window), "destroy",
      GTK_SIGNAL_FUNC(CloseRequest), NULL);

  gtk_widget_show(window);
  gtk_main
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值