(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 [193.136.138.118])
        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;
 boundary="Multipart_Thu_Jan_11_19:48:09_2001-1"
Message-Id: <E14Gnhh-0005zH-00 anonimo isr ist utl pt>
Date: Thu, 11 Jan 2001 19:48:09 +0000
Status: RO

--Multipart_Thu_Jan_11_19:48:09_2001-1
Content-Type: text/plain; charset=US-ASCII


  Hello,

  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.

  Cheers,

  Etienne


--Multipart_Thu_Jan_11_19:48:09_2001-1
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";>
<head>
  <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" />
</head>

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

<h2>Abstract</h2>

<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>

<h2>Introduction</h2>

<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
widgets</a></h2>
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
href="http://imagic.weizmann.ac.il/~dov/freesw/gtk/gtk-image-viewer/";>gtkimageviewer</a>
has a header file <code>gtk_image_viewer.h</code>which defines the type
<code>GtkImageViewer</code> ((what about
<code>GtkImageViewerClass</code>?)).</p>

<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>
<ul>
  <li><code>Makefile.PL</code></li>
  <li><code>pkg.defs</code></li>
  <li><code>GtkImageViewer.pm</code></li>
  <li><code>xs/GtkImageViewer.xs</code></li>
</ul>

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

<p></p>
</body>
</html>

--Multipart_Thu_Jan_11_19:48:09_2001-1
Content-Type: text/plain; charset=US-ASCII




--Multipart_Thu_Jan_11_19:48:09_2001-1--







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