(no subject)

From etienne anonimo isr ist utl pt Thu Jan 11 20:46:55 2001
Received: from anonimo.isr.ist.utl.pt (mail anonimo isr ist utl pt [])
        by isr.isr.ist.utl.pt (8.9.3/8.9.3) with ESMTP id UAA10067
        for <etienne isr ist utl pt>; Thu, 11 Jan 2001 20:46:54 GMT
Received: from etienne by anonimo.isr.ist.utl.pt with local (Exim 3.12 #1 (Debian))
        id 14Gnhh-0005zH-00; Thu, 11 Jan 2001 19:48:09 +0000
From: Etienne Grossmann <etienne anonimo isr ist utl pt>
To: gtk-perl-list gnome org
Subject: widget tutorial (warming up for)
CC: etienne isr ist utl pt
Reply-to: etienne isr ist utl pt
User-Agent: WEMI/1.13.7 (Shimada) FLIM/1.13.2 (Kasanui) Emacs/20.7 (i386-debian-linux-gnu) (with unibyte mode)
MIME-Version: 1.0 (generated by WEMI 1.13.7 - "Shimada")
Content-Type: multipart/mixed;
Message-Id: <E14Gnhh-0005zH-00 anonimo isr ist utl pt>
Date: Thu, 11 Jan 2001 19:48:09 +0000
Status: RO

Content-Type: text/plain; charset=US-ASCII


  I will soon have a little time to work on a tutorial on using custom
gtk widgets in perl. 

  I started it in html, but I am not sure that's the best format. I am
more familiar with latex; would that be an acceptable format?

  Here is what I did up to now, that's just a start.



Content-Type: text/html; charset=US-ASCII
Content-Transfer-Encoding: 7bit

<?xml version="1.0" encoding="iso-8859-1"?>
<html xmlns="http://www.w3.org/1999/xhtml";>
  <title>Using Gtk widgets from perl</title>
  <meta name="GENERATOR" content="amaya V4.0" />
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<p style="text-align: center"><big><strong>Using Custom Gtk Widgets in


<p>Sometimes you see a gtk widget and think : "If only I could use it from
inside Perl ..." This tutorial is about using <a
href="http://www.gtk.org";>gtk</a> widgets --written in C-- from perl. Widgets
that are included in the <a href="http://www.gtk.ork";>standard distribution of
gtk+</a> are supported by the <a
href="http://projects.prosa.it/gtkperl/";>standard distribution of Gtk-Perl</a>
((right?)). Here, we will see how third-party or custom widgets, maybe one you
wrote yourself, can be accessed from perl.</p>


<p>To reach this goal and try to understand how it was reached ((I should
understand what's going on too...)), we shall <a href="#Basics">first</a> see
how the C interface to a gtk widget works : a widget has an associated header
file which defines some data types and interface functions. <a
href="#Making">Then</a> we see how a perl module can be made that allows to
use this widget.</p>

<p>Basic knowledge of gtk programming ((here ref)), perl modules (see man
perlmod and man perlxs) is assumed. Also it is assumed that a recent version
of gtk+ and its perl bindings, <a
href="http://projects.prosa.it/gtkperl/download.html";>Gtk-Perl-0.7004</a> or
better, are installed, as well as the widget under consideration ((HERE: Ref
to creating custom widgets)).</p>

<h2><a name="Basics1" id="Basics">Basics of C interface to Gtk
A gtk widget has a header file in which at least one datatype is defined. An
object of this type is what a C program sees of a widget. The header file also
defines functions used to manipulate this widget. 

<p>Take, for example, Dov Grobgeld's widget <a
has a header file <code>gtk_image_viewer.h</code>which defines the type
<code>GtkImageViewer</code> ((what about

<h2><a name="Making" id="Making">Making a Perl module</a></h2>

<p>Create a directory that will contain the module. An appropriate name for
the widget <code>gtkimageviewer </code>is GtkImageViewer. This directory will
contain the following files :</p>

<p>And the usual <code>MANIFEST, README </code>... (see man perlmod)</p>


Content-Type: text/plain; charset=US-ASCII


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]