Paste a good GTK + study note

Source: Internet
Author: User
Tags gtk signal handler

GTK
(Gimp Toolkit)
Original
Image processing tool gimp (GNU Image Manipulation
Program
The development toolbox is later developed as a cross-platform graphic interface. GTK is based on the C language, but is not limited to the use of C
You can also use
Programming languages such as C ++, Java, PHP, Perl, Python, and Ruby
Bindings
), This file will record some GTK +
Experience, the Environment used is
Ubuntu 10.10.

 

 

 

Inbound bytes


First, let's look at several simple GTK programs and get a preliminary understanding of some core features.

  • Hello! World! Orz ..
The first step is first
Overcome the security problem of GTK, and then a simple hello! World! Orz...
  •  

    • Ubuntu
      Xia'an District

      GTK
    • First
      Several GTK programs

    • Windows
      Next, the first GTK Program

    • GTK
      Objects in

  • Signal and callback
In GTK
The operation on the component will produce a specific signal, and connect the signal handler to a specific callback function to complete processing of a specific action.
  •  

    • Enable
      Use signal to close the internal window

    • From
      Callback function

    • Internal
      Generation and stop of Signal

  • Event handling
Gdk
The event will be broadcast to the gtkwidget.

Event
Phase
Corresponding event signal, and then process the event through the callback function.
  •  

    • Gdk
      Event Structure

    • GTK
      Event handling function

    • Things
      Event mask)

  • Basic layout Configuration
Basically, it is through water.
The flat and vertical Package boxes place components in the boxes to complete the layout configuration.
  •  

    • Gtkhbox
      And gtkvbox

    • Gtkframe
      And gtkbuttonbox

    • Gtktable
  • Others
GTK
On the official website, there are many examination documents and examples, which are mandatory for entry.
  •  

    • GTK
      Exam preparation document

    • Introduction
      Glade

Basic component


Components cannot be completed.

Mainly in
Introduce several
The role of basic components.

  • By hour
Press accept as the upper window
The most basic components in the program.
  •  

    • Gtkbutton
      And gtktogglebutton

    • Shadow
      Image and text

    • Gtkcheckbutton
      And gtkradiobutton

  • Speaker
The speaker uses and enables
User-Defined information communication and communication.
  •  

    • Gtkmessagedialog
    • Gtkaboutdialog
    • Gtkcolorbutton
      And

      Gtkcolorselectiondialog
    • Gtkfontbutton
      And

      Gtkfontselectiondialog
    • Gtkfilechooserbutton
      And

      Gtkfilechooserdialog
    • Enable
      Use gtkdialog to customize the caller

  • Text delimiter
The text Delimiter is used by the user.
The basic component of the inbound data.
  •  

    • Gtkentry
    • Gtkspinbutton
    • Gtktextview
  • Optional
    Ticket clearing
Clear orders for this region
Comply with the MVC design, use the above Code but use the high attention.
  •  

    • Gtkcombobox
    • Gtkcombobox
      And gtkliststore

    • Gtkcombobox
      And gtktreestore

    • Gtktreeview and
      Gtkliststore

    • Gtktreeview and
      Gtktreestrore

  • Layout element
Except for the three
In addition to basic layout configuration, you can also use some layout components to facilitate component group and layout cutting.
  •  

    • Gtknotebook
    • Gtkpaned
    • Gtkscrolledwindow
    • Gtkalignment,
      Gtkfixed and gtklayout

    • Gtkframe
      And gtkaspectframe

 

Input component
Use


Let's take a look at the use and combination of some options, columns, and other components, as well as functions such as sorting and printing.

  • Component
The option is the most out-of-the-box window program.
This is a common feature.
  •  

    • Gtkhandlebox
    • Gtkmenubar,
      Gtkmenu and gtkmenuitem

    • Gtkcheckmenuitem,
      Gtkradiomenuitem and

      Gtktearoffmenuitem
    • Gtkuimanager

  • Column element
Level column, tool column,
The condition column.
  •  

    • Gtkprogressbar
    • Gtktoolbar
    • Gtkstatusbar
  • Other components
Less prosperous
... Orz...
  •  

    • Gtkstyle
      And resources

    • Gtklabel
    • Gtkscale

    • Gtkentrycompletion
    • Gtkarrow
    • Gtkruler
    • Gtkassistant
    • Gtkcalendar
    • Gtkdrawingarea


Glib

Glib is
One of the functions required by GTK, but it is a ready-to-use function.

  • Basic functions, collection, and utility functions
Some are not commonly used
Function, first put together into... orz
  •  

    • Glib
      Basic topology and collection

    • Gtimer
    • Timeout
      And idle

    • Bytes
      Environmental Information

    • Daily
      (Logging)

  • Ingress inbound and outbound
To learn about some basic features
Method of obtaining the case details, object information, and the use of inbound and outbound channels.
  •  

    • Base
      In this case

    • Contents
    • Giochannel
      Case handling

    • Giochannel
      And Pipe

  • Information Structure and memory configuration
Let's take a look.
Glib provides common information structure processing and dynamic memory configuration.
  •  

    • Gstring
    • Garray, gptrarray,
      Gbytearray

    • Gslist,
      Glist

    • Ghashtable
    • Gtree
      And gnode

    • Note
      Graphical Configuration

  • Bytes
    Rows
Glib
Provides gthread support for multiple response rows.
  •  

    • Gthread
    • Gmutex
    • Gcond

Appendix
  • GTK +
    2.0 tutorial
  • GTK +
    Reference manual
  • GTK +
    /Gnome Application Development

  • GTK +
    And glade3 GUI Programming Tutorial

  • GTK +
    2.0 Tree View tutorial

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.