Re: A perl/Gtk Newbie



On Friday, March 5, 2004, at 01:22 AM, john knops wrote:

Thanks for the advice James. I guess I was trying to do it easy. I've fiddled around a little with Perl/Tk so hopefully that will help. I've already looked at the tutorial at www.gtk.org but it's a bit light on how to create a canvas with text, images and a coloured background.

There are two approaches:


a) If you have mostly text with a few images, you'll want to use a GtkTextView (Gtk2::TextView in gtk2-perl) and learn how to embed pictures and modify things with tags. The GtkTextView is modeled after the Tk Text widget, so you should feel at home.

There don't appear to be a lot of tutorials about the TextView on the web, but gtk-demo includes some code that test drives it pretty well. http://cvs.sourceforge.net/viewcvs.py/gtk2-perl/gtk2-perl-xs/Gtk2/gtk- demo/textview.pl?rev=1.12&view=auto



b) If you have mostly graphical components, you will be more interested in GnomeCanvas (Gnome2::Canvas in gtk2-perl, distributed as a separate module). GnomeCanvas is, again, modeled after its Tk counterpart; it is distributed separately because libgnomecanvas its anti-aliased mode uses libart, whereas gtk+ avoids this dependency.

Most information i could find about the gnome canvas on the web dates from gnome 1.x, but you're in luck, because it has barely changed since then:
http://developer.gnome.org/doc/GGAD/cha-canvas.html
http://developer.gnome.org/doc/tutorials/gnome-libs/gnomecanvas- widget.html



So watch this space for more questions over the coming weeks.

/me watches intently


--
Jolt is my co-pilot.
  -- Slogan on a giant paper airplane hung in Lobby 7 at MIT.
     http://hacks.mit.edu/




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