Install GTK in Ubuntu

Source: Internet
Author: User

Sudo apt-Get install build-essential # This will install basic programming tools such as gcc/g ++/GDB/make
Sudo apt-Get install gnome-core-devel gnome-Dev-doc # This will install libgtk2.0-dev libglib2.0-Dev and other development-related library files in the GNOME Environment
Sudo apt-Get install PKG-config # used to automatically find the header file and library file location when compiling the GTK Program
Sudo apt-Get install devhelp # This will install the devhelp GTK document viewing program
Sudo apt-Get install libglib2.0-Doc libgtk2.0-doc # This will install the GTK/glib api reference manual and other help documents
Sudo apt-Get install Glade libglade2-dev # This will install the GTK-based interface Constructor

 

Apt-Get automatically links to the URL above the software source (source. List) to find the software name you provide.
If the installation program is found, it is automatically downloaded to your/var/Cache/apt folder and installed.

 

# Include <GTK/GTK. h>
Void Hello (gtkwidget * widget, gpointer data)
{
G_print ("Hello Ubuntu! /N ");
}
Gint delete_event (gtkwidget * widget, gdkevent * event, gpointer data)
{
G_print ("delete event occurred/N ");
Return (true );
}
Void destroy (gtkwidget * widget, gpointer data)
{
Gtk_main_quit ();
}
Int main (INT argc, char * argv [])
{
Gtkwidget * window;
Gtkwidget * button;
Gtk_init (& argc, & argv );
Window = gtk_window_new (gtk_window_toplevel );
Gtk_signal_connect (gtk_object (window), "delete_event", gtk_signal_func (delete_event), null );
Gtk_signal_connect (gtk_object (window), "Destroy", gtk_signal_func (destroy), null );
Gtk_container_set_border_width (gtk_container (window), 10 );
Button = gtk_button_new_with_label ("Hello Ubuntu! ");
Gtk_signal_connect (gtk_object (button), "clicked", gtk_signal_func (Hello), null );
Gtk_signal_connect_object (gtk_object (button), "clicked", gtk_signal_func (gtk_widget_destroy), gtk_object (window ));
Gtk_container_add (gtk_container (window), button );
Gtk_widget_show (button );
Gtk_widget_show (window);/* display a window */
Gtk_main ();/* enter the main loop */
Return (0 );
}
 
Save as: gtkhello. c
Compile and run the following command:
Code:
 
$ GCC gtkhello. C-o gtktest 'pkg-config -- cflags -- libs GTK +-1000'
$./Gtktest

 

 

 

 

Installation Error

Get: 2 http://cn.archive.ubuntu.com jaunty-updates/main Python-gobject destination .1-1ubuntu3 [318kb]
Error http://cn.archive.ubuntu.com jaunty-updates/main Python-gobject cmd.1-1ubuntu3
Connection Failed
Failed to download http://cn.archive.ubuntu.com/ubuntu/pool/main/p/pygobject/python-gobject_2.16.1-1ubuntu3_i386.deb connection
E: several software packages cannot be downloaded. Can you run apt-Get update or add the -- fix-missing option to try again?

 

Used on interl x86 Python-gobject_2.16.1-1ubuntu3_i386.debDownload Page

If you are running Ubuntu, try to use a software package manager like aptitude or synaptic, instead of manually downloading and installing the software package from this webpage.

You can use any source image in the following list/Etc/APT/sources. ListAdd a row in the file as follows:

deb http://cz.archive.ubuntu.com/ubuntu jaunty-updates main 

Replace with the final source ImageCz.archive.ubuntu.com/ubuntu.

You canPool/main/P/pygobject/Download the required files in the subdirectory:

North America

  • Mirrors.kernel.org/ubuntu
  • Ftp.osuosl.org/pub/ubuntu
  • Lug.mtu.edu/ubuntu
  • Ubuntu.mirrors.tds.net/ubuntu
  • Ubuntu.secs.oakland.edu
  • Developer.mcs.anl.gov/pub/ubuntu
  • Mirrors.cat.pdx.edu/ubuntu
  • Ubuntu.cs.utah.edu/ubuntu
  • Ftp.ussg.iu.edu/linux/ubuntu
  • Mirrors.xmission.com/ubuntu
  • Mirrors.cs.wmich.edu/ubuntu
  • Gulus. usherbroke. ca/pub/distro/Ubuntu

Asia

  • Kr.archive.ubuntu.com/ubuntu
  • Th.archive.ubuntu.com/ubuntu
  • Developer.lupaworld.com/ubuntu
  • Kambing.vlsm.org/ubuntu
  • Ubuntu.mithril-linux.org/archives
  • Mirror. In. Th/Ubuntu
  • Developer.rootguide.org/ubuntu

Africa

  • Za.archive.ubuntu.com/ubuntu

Europe

  • Cz.archive.ubuntu.com/ubuntu
  • De.archive.ubuntu.com/ubuntu
  • Dk.archive.ubuntu.com/ubuntu
  • Es.archive.ubuntu.com/ubuntu
  • Fr.archive.ubuntu.com/ubuntu
  • Ge.archive.ubuntu.com/ubuntu
  • Gr.archive.ubuntu.com/ubuntu
  • Hr.archive.ubuntu.com/ubuntu
  • Mt.archive.ubuntu.com/ubuntu
  • Nl.archive.ubuntu.com/ubuntu
  • No.archive.ubuntu.com/ubuntu
  • Se.archive.ubuntu.com/ubuntu
  • Yu.archive.ubuntu.com/ubuntu

Australia and Oceania

  • Nz.archive.ubuntu.com/ubuntu
  • Nz2.archive.ubuntu.com/ubuntu
  • Ftp.iinet.net. au/pub/Ubuntu
  • Developer.optus.net/ubuntu
  • Ftp.filearena.net/pub/ubuntu
  • Pai.pacific.net. au/Linux/Ubuntu

If you feel that the speed of the above sites is not ideal, please check our complete source image list.

Note: Some browsers require you to explicitly tell them that you only want to save these files, rather than viewing or running them. For Firefox or Mozilla, you may need to click the above URL link while holding down the Shift key.

Related Python-gobject_2.16.1-1ubuntu3_i386.debFor more information:
Actual Size 318114 bytes (310.7 Kbyte)
MD5 Verification Code 73c5d22507425007c7425b5aa96b5d2
Sha1 Verification Code D90d776ad306ab2f0a63115c3c32ad224b4a7e98
Sha256 Verification Code Bytes

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.