---
title: "GTK 入門文件"
author: "cjc"
date: "2008-06-19T12:06:13Z"
tags: []
slug: "gtk"
draft: false
lastmod: "2008-06-19T12:06:13Z"
id: 402861
url: "https://cjc.iteye.com/blog/402861"
---

&lt;script&gt;function StorePage(){d=document;t=d.selection?(d.selection.type!='None'?d.selection.createRange().text:''):(d.getSelection?d.getSelection():'');void(keyit=window.open('http://www.365key.com/storeit.aspx?t='+escape(d.title)+'&u='+escape(d.location.href)+'&c='+escape(t),'keyit','scrollbars=no,width=475,height=575,left=75,top=20,status=no,resizable=yes'));keyit.focus();}&lt;/script&gt; 先來嘗試一下幾個簡單的 GTK 程式，並初步了解一些核心特性。

- Hello!World! Orz..

第一步，當然是先 克服 GTK 的安裝問題，然後來個簡單的 Hello!World! Orz...

- - [Ubuntu 下安裝GTK](http://caterpillar.onlyfun.net/Gossip/GTKGossip/GTKUnderUbuntu.html)
  - [第一 個 GTK 程式](http://caterpillar.onlyfun.net/Gossip/GTKGossip/FirstGTK.html)
  - [GTK 的物件導向架構](http://caterpillar.onlyfun.net/Gossip/GTKGossip/GTKOO.html)

<!--THE END-->

- Signal 與 Callback

在 GTK 的元件上操作，會發出特定的 Signal ，將 Signal 連接至特定的 Callback 函式，以完成對某個動作的處理。

- - [使 用 Signal關閉視窗](http://caterpillar.onlyfun.net/Gossip/GTKGossip/SignalConnect.html)
  - [自 訂 callback 函式](http://caterpillar.onlyfun.net/Gossip/GTKGossip/CustomCallback.html)
  - [內 建 Signal 的發射與停止](http://caterpillar.onlyfun.net/Gossip/GTKGossip/SignalEmitStop.html)

<!--THE END-->

- 事件處理

GDK 事件會傳播給GtkWidget，引發一個與事件相 對應的事件 Signal，再透過 Callback 函式處理事件。

- - [GDK 事件結構](http://caterpillar.onlyfun.net/Gossip/GTKGossip/GDKEventStructures.html)
  - [GTK 事件處理函式](http://caterpillar.onlyfun.net/Gossip/GTKGossip/GTKEventHandler.html)
  - [事 件遮罩（Event Mask）](http://caterpillar.onlyfun.net/Gossip/GTKGossip/EventMask.html)

<!--THE END-->

- 基本版面配置

基本上就是透過水 平與垂直包裝盒，將元件置於其中以完成所需的版面配置。

- - [GtkHBox 與 GtkVBox](http://caterpillar.onlyfun.net/Gossip/GTKGossip/GtkHBoxGtkVBox.html)
  - [GtkFrame 與 GtkButtonBox](http://caterpillar.onlyfun.net/Gossip/GTKGossip/GtkFrameGtkButtonBox.html)
  - [GtkTable](http://caterpillar.onlyfun.net/Gossip/GTKGossip/GtkTable.html)

<!--THE END-->

- 其它

GTK 官方網站上，有許多的參考文件與範例，為入門時的必看資料。

- - [GTK 參考文件](http://caterpillar.onlyfun.net/Gossip/GTKGossip/GtkReference.html)
  - [簡介 Glade](http://caterpillar.onlyfun.net/Gossip/GTKGossip/Glade.html)