Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

GUI Programming

by vroom (Pope)
on May 31, 2000 at 21:24 UTC ( #15653=sourcecodesection: print w/replies, xml ) Need Help??
Recombine still image sequences into movies
on Feb 25, 2009 at 17:51 UTC
by zentara
Want to make a highly succesful how-to to put on You-Tube? Or maybe speed up looking thru your security camera still images?

Here you go....put a sequential list of jpg's in a subdir, and run this script on it. The output flv is conveniently named as 111****.flv so as to be at the top of your dir list. :-)

A sample of me fixing a lamp is lamp_fix

Gtk2 2d Table Demo
on Feb 02, 2009 at 18:30 UTC
by zentara
A simple demo, to show how to display data in a nicely colored Table in Gtk2. Mouse actions on elements is demonstrated. A Table in Gtk2 more closely resembles an html table, unlike plain Tk Tables, which are more like cell grids.
Gtk2 Simple Image Fade
on Jan 19, 2009 at 17:43 UTC
by zentara
A very simple demo of fading between images. The one thing to note, is that composite on a pixbuf will be cumulative, so notice I reset the base pixbuf to it's original on every timer call. There may be better ways around the problem.

Also I chose an alpha increment and timer speed to be effective, yet not too cpu intensive.

Additionally note that I read in the images to be the same scale. In a more complex "slideshow", you will have to deal with the effects of compositing files of different sizes.

Tk Canvas Interactive bar graph
on Jan 12, 2009 at 20:29 UTC
by zentara
A simple way to have mouse-interactive bar graphs. Just the basic stuff: generating contrasting bg fg colors, vertical text labels, and saving to postscript. Add whatever features you want.
Gtk2 Entry with validation and Pango coloration
on Jan 04, 2009 at 17:32 UTC
by zentara
Emmanual Rodriguez has come out with a helper module to do validation on an Gtk2::Entry widget. See Gtk2-Ex-Entry-Pango

This is a slightly modified version of one of the module's examples, that can be used to get data from a user. It also has a clever non-editable prompt, in the expose event.

Gtk2 Bubble notification windows
on Nov 29, 2008 at 19:12 UTC
by zentara
This package allows you to pop "cartoon-like bubble windows" centered on another window, or a StatusIcon, to send a notification message. It's based on the great work of Dirk van der Walt and his Gtk2 Study Guide

You can specify a window to pop on, or an x,y location.

Gtk2::StatusIcon Demo
on Nov 25, 2008 at 19:41 UTC
by zentara
I recently posted Gtk2 TrayIcon Demo, but it turns out that TrayIcon dosn't work on Win32, and is being phased out in favor of StatusIcon. So here basically is the same code, but using StatusIcon (which will accept most any image and auto-magically make an icon for you). This code is mostly used to demonstrate how to setup a nice right-click configuration window. The left click just tails the script itself.....you can make it do whatever you want.
Gtk2 TrayIcon Demo
on Oct 28, 2008 at 18:17 UTC
by zentara
UPDATE Oct 29, 2008 I just found out that the separate module TrayIcon is not crossplatform ( not work on win32), and I should have used StatusIcon( a part of Gtk2 ) instead. I will try to update this as soon as I can to using StatusIcon. Sorry for any inconvenience.

This is a little demo to show some tricks to make a nice Gtk2::TrayIcon based app. It does nothing but tail itself, but includes a generic outline for including multi-colored icons, flashing the icon, and a configuration setup which you can easily modify.

A left click on the icon will popup a window tailling $0. This can be useful if you want to tail /var/log/messages( with correct permissions), etc, or if you want to setup an IO::Notify type watch on a directory. A directory and file selector option are in the configuration window. I may put the output of Sys::Info into a table as a real use.

A middle click will start the icon blinking, a second middle-click stops it. This just demos how to make your trayicon flash efficiently.

A right-click brings up the menu. It is full of easily modifiable code, to allow you to do what you want. All the checkbuttons do is change icon color, but you can make them do whatever you want.

I originally started to write a TrayIcon app, similar to Gufw a PyGtk2 TrayIcon app to monitor a firewall, but decided to write a generic one first.

After configuration, if you hit the "accept" button, it will save the options to __DATA__ for the next startup.

Transparent 3d logo/button with ImageMagick
on Oct 01, 2008 at 19:05 UTC
by zentara
I liked the 3b button/logo shown at better 3d logos but had great difficulty translating the shell commands to Perl. Here is what I came up with, it works well, and it's quite possible it can be streamlined....let me know if you see code bloat. Open it in Gimp to see it's transparency.
Gtk2 ListStore Thumbnail/Image Viewer
on Sep 30, 2008 at 18:53 UTC
by zentara
A simple ListStore method of showing thumbnails and images. Useful for single directory browsing of images. Shows (one way) how to make nice Lists with pictures and text with Gtk2.
Crosshairs on Gtk2 Gnome2::Canvas
on Sep 17, 2008 at 20:05 UTC
by zentara
Crosshairs are a professional looking addition to graphic programs.

I recently tried the Gtk2-Ex-Xor module's crosshair on the Gtk2 canvas type items, (Gnome2::Canvas and Goo::Canvas), and thanks to Kevin Ryde (module author), it now works on them. There was some difficulty because crosshairs typically are written on the low-level gdk window, but the canvases, had their own special windows. Anyways, this shows how to add crosshairs to canvas widgets.

Goo::Canvas Graphing demo
on Aug 07, 2008 at 16:06 UTC
by zentara
The Goo::Canvas is ideal for solving many graphing problems. Like multiple y-axis (not shown here :-), zooming, and saving to pdf. This demo shows how to reverse the y axis (typically negative on canvases), so your plots can be in the normal cartesian direction. This makes plotting easier, your x,y values are plotted without the need to fudge their direction. This comes at a small price of needing to invert some text in the group. Margins are also taken care of nicely, by translating the plotting group from the edges, so it all stays 0,0 for plotting.

2 ways of rotating text are shown. One is an actual rotation of the Y_axis_label; and the other is the x tick values, which are automatically wrapped by 'char', to width 1, to give a vertical number..... the vertical spacing is a bit off, compared to fully rotated text, but it is easy to read ( no need to cock your head sideways to read :-) )

Zooming and pdf saving are also shown. This is just my proof-of-concept demo, to test ideas before making a full-fledged Goo::Canvas::Graph module.

Goo'ey Waves of Goo_ness
on Aug 05, 2008 at 17:52 UTC
by zentara
Just an optical illusion, based on the Goo::Canvas, to help hypnotize your girlfriends. :-) Shows rotations and scaling.
Goo Canvas deleting items
on Aug 04, 2008 at 14:55 UTC
by zentara
The Goo::Canvas does not have an easy method, like ->destroy, to remove items. Thanks to some help from the Gtk2/Perl maillist, I show 2 methods, one is the right mouse click on the item. The general procedure, is you need to find the item's parent group, then get the group's id number for the item, then $group->remove_child ($id_number). There are some peculiarites. like if you have 2 items 0 and 1, removing 0 first then 1 will cause an error, because 1 gets demoted to 0 after 0 is removed.

A simpler way is to put everything in it's own group and remove the group.

TkCodex: GUI Code Viewer (linux)
on Jul 29, 2008 at 04:28 UTC
by halfcountplus
TkCodex is a specialized code VIEWER that will help you give up sliced bread. I built it for me and my_nihilist while we're learning C, so its been getting tweaked for months now and runs without errors. It works as a single script without configuration, includes a quick reference, and requires no non-standard modules.

The original idea was a read-only GUI app for scanning code when I couldn't remember the exact format of a seldom used command -- the way one might use "grep -r obscurnew()" on a tree of scripts. It also turned out to be great for development and debugging: rather than doing split screens in vim or repeated cat | less scans I now had a specific tool for highlighting all instances of a variable or function call in works-in-progress. I then intended to add a couple of sets of color to distinguish one highlight search from another. TkCodex does that, and it indexes the searches in a side panel, creating a clickable list of instances by line number. It also allows you to quickly add hypertext style notes to a piece of code. These notes and highlights can then be saved in a seperate file, without the possibility of affecting the code itself. You can remove individual or sets of highlight(s) as easily as you create them. There is a "command history" like less and vim, so you don't have to type in a previously done search.

Since TkCodex performs a unique set of functions (as far as I know), it is not based on any existing GUI interface or concept. Also, it uses key macros for speed rather than a lot of 2D mouse menus. I didn't try to include syntax highlighting.

Here's two ways to use it:
  • Find examples: Launch TkCodex from the command-line with a directory and a regular expression, and it will start up with the results of a recursive grep style search ranked in a list of files. Then you just hit a button and the "top four" files are loaded into seperate tabs with the regexp highlighted AND INDEXED, allowing you to quickly peruse a number of (eg.) practically applied commands. If you use vim and have "--remote" compiled in, you can even send a line directly from TkCodex into INSERT mode, saving cut/paste or typing time.
  • Decyphering a single file: Often a major part of this is tracking global variables, function calls, etc. You can load the file, AUTOMATICALLY index all (perl) subroutines in a side-panel (and now go from one to another with a single click!), then begin highlighting ALL instances of a particular variable, unhighlite them, manually highlite anything, and index all this in the side-panel too. You can even add little hypertext notes as you go and save all this information in a seperate file that then can be applied to the same script again later.

Monitored in top, TkCodex runs with with a stable residential memory size of 14 Mb.

Update: A complete set of instructions is in the __DATA__ section of the script.
If you want to read an html version or look at screenshots,
TkCodex is now under GPL in its most updated form at SourceForge:

tkcodex.sourceforge.net
Jumping Desktop Windows with Gtk2
on Jul 14, 2008 at 18:42 UTC
by zentara
Warning...contains some X windows trickery, and should not be run while important things are going on on your desktop. It will not destroy anything, just be annoying.

This is some Gtk2 code that will find all non-maximized windows (on all virtual desktops), and start them jumping like crazy. A control window is placed in the center (immune to the jumping), which has a global keyboard grab, so you can kill the program.

Use cautiously. :-)

Developed for a school audio visual tech, who needed to pretend to be fixing malfunctioning monitors, all the while partying in the back room. :-)

It does show an important concept, of doing a global keyboard grab with Gtk2.

Gnome2::Canvas Scribble with Image
on Jul 09, 2008 at 20:27 UTC
by zentara
Loads an optional image on a canvas, lets you draw with selected brush size and color, and save a screenshot. Fast and handy for marking up maps.
Goo Canvas and transparent images
on Jul 03, 2008 at 20:02 UTC
by zentara
A discussion arose recently about overlaying radar weather plots on a map. Well this kind of demonstrates all you need. It shows how to load images onto the canvas, and make a color transparent. The first time it runs, it gets a little map from google, and the overlay is base64encoded into the script. It is a little green plane that flies in circles over the map. This will work with a Gnome2::Canvas also (with some minor syntax changes), but I use Goo because it implements saving to postscript (amoung other formats).

Updated 7/25/2008... added more transparency to the airplane....it was solid green, on a black background, in which the canvas made black transparent. I added semi-transparency to it, so it looks similar to see the thru clouds of a weather map. This was done by adding an alpha layer to the plane itself, and setting the alpha to black. This made the green semi-transparent by removing it's black constituent.

Tk RGBColorDialog
on Jun 22, 2008 at 18:23 UTC
by zentara
I got tired of trying to use the cumbersome Tk ColorDialog ( which I could never get to work simply). I wanted a popup dialog, with RGB sliders, that simply returns the RGB color, on the Ok button press. Nothing fancy, but just works in a simple straightforward manner. Presented as a package, but can easily be put into module form.

UPDATE Jun23, 2008 Removed uneeded hex2dec sub, which was intended to be used if you fed the package an initial setting. See comment below if you need an initial color option.

Tk Canvas Image Sampler/ Montage builder
on Jun 19, 2008 at 18:57 UTC
by zentara
UPDATED Jun20,2008 Simplified multiple canvas bindings, and made it all left-mouse-button operation. I like the simplicity of left-mouse single clicks and drags.

This recursively browses a directory of png and jpg images (you can add more). It makes thumbnails for selection with a left click on subdirs. Upon left-click selection on a thumbnail, the full image is displayed in the source canvas, and a left-mouse-drag will draw a rectangular region on the image. Upon left-button release, the region will be copied to a second target canvas, where it can be positioned and saved.

Useful for easy-mouse selections in creating montages. The entire target canvas can be saved as a jpg.

So for instance, you can open a 100 photos, copy off only the faces, arrange them to please yourself, then save the whole montage as a jpg.

For the more advanced Tk users, there is an interesting use of ImageMagick blobs to convert postscript directly to jpg, without temp files.

Goo::Canvas Waypoint marker w zoom/save to svg and pdf
on Jun 04, 2008 at 18:46 UTC
by zentara
You can load an image, and make waypoints. Zoom and save to svg or pdf. (I don't know if it's a bug on my system, but it won't save a loaded svg map as svg (the waypoints show up but the svg map is all black), but will save to pdf just fine. Add an image of your choice and uncomment the section for loading it. I just start with a rectangle for this demo. For best results with an image, use a huge image and scale the canvas down after loading it, so the resolution stays good when zooming. I have 1, but it's 3 megs, so I won't base64encode it into the script. :-)
Tk April Fools
on Apr 01, 2008 at 19:57 UTC
by zentara
I guess it's getting pretty hard to create a realistic April Fool's prank, so here is a lame one. :-) So I don't cause busy people too much aggravation...... Escape key will exit.
Tk Virtual Keyboard Example
on Mar 06, 2008 at 18:01 UTC
by zentara
I received a few requests on how to actually use Tk Virtual Keyboard. Here is a simple example. I encoded the key and password (but left the method in there for instructions), so just looking at the script, will not reveal anything. Ideally, it would be nice to have the key and password on a usb key.

Also, this is just a simple example, I believe it would be possible to run gpg thru IPC::Open3, and you could print the selected keys for the password to your gpg key directly into the gpg input pipe. So you would have your gpg private key on a usb stick, then use the virtual keyboard to enter the armoring password. So the test password for this is 'yadda yadda yadda yadda' ......without the single quotes.

"Rubics Cube" game - part 2
on Mar 04, 2008 at 15:29 UTC
by tos
This source-part has to be concatenated after the first one first one

Sorry, but "on the fly" i don't see other quick possibilities

:-)

"Rubics Cube" game
on Mar 04, 2008 at 14:54 UTC
by tos
Dear Monks,

my way to gui-programming was heavily influenced by perl/Tk. It ever impressed me and I like the examples that come with „widget“. So i always wanted to create my own (bigger) Tk-application.

Someway the idea occured to me to tinker the „Rubics Cube“ with the instruments that perl/Tk offers. After first experiences with a graphical rather rudimentary approach the second attempt was an actual 3d-application.

This for me ambitious project led me to a broad variety of problems. Solving these improved (as i think) my way of programming and my comprehension. Additionally i had to recall some mathematical basics from linear algebra. Briefly said, my tinkering didn't make me more stupid :-).

Meanwhile qb3 („kjuBeeThree“), as the application is called, has grown up to 5000 lines of code and the result relatively satisfies me. Unfortunaly i didn't reach one of my aims. Qb3 isn't able to solve given twisted cubes on its own.

My ambition concerning qb3 has faded in the last time. There are a lot of other perlish things which now stronger attract my attention than this.

Nevertheless i would like to see qb3 getting better and more capable. Therefore i'll give my „Unfinished“ to the PM-community, hoping that perhaps one or two are in the mood to work along on qb3. It also might be that there are quite interesting techniques to be seen in the code. Especially the own „3d-engine“ could be of interest.

Qb3 has a lot of bugs and surely there are many things that could be done better. But if seen pragmatically and not with an academic claim i would like to say that the result so far is quite cute. I mostly like to see it shuffle while it's rotated.

Qb3 runs „out of the box“ on unix and windows if Tk.pm is installed. Regard the shape of the mousepointer. If it changes its appereance it's worth to click (and move). Try all mousebuttons.

For editing the source use vim with tabstop=3 and :set fdm=marker.

$Id: qb3,v 0.68 2008/03/04 14:30:10 tos Exp tos $

# md5sum qb3 81b7f0a98394acd86d51132094c20835 *qb3

You have to concatenate the four sourceparts in order. Then you'll have gotten the whole.

Download the parts as qb3-1,2,3,4. Then make a

cat qb3-? >qb3

the result should have the above shown md5sum

Happy playing and regards, tos

p.s.: as you surely already noticed this isn't my native language. So, please bear with me. Of course laughing is allowed. I can't hear it anyway. :-)

p.p.s.: there is a picture of qb3 on my homenode

Surround-inspired Gtk demo
on Jun 09, 2007 at 21:59 UTC
by drench
Since there's been no activity in the GUI programming category for nearly 4 years, maybe it's appropriate that this code is something I wrote in the early 2000s, teaching myself basic Gtk while commuting to and from work. Inspirations: the Atari 2600 "Surround" cartridge and graphics programming on the Apple II and Atari 800, and randomness. Quick notes: the escape key erases the canvas. Other mouse and key events have little effect (try & see), and see the code for some undocumented command-line options (redundant; the whole thing's undocumented, unless you count this). Mainly it was fun to write and kind of fun to watch run.
Tk Photo Slideshow, with scrolling and scaling
on Oct 18, 2006 at 17:47 UTC
by jdporter

This is meant primarily to illustrate how to load and display photo images in Perl-Tk. Secondarily, it shows how to scale images, how to put images into a scrolling window, and how to "drag" such a image.

Usage: slideshow.pl [DIRECTORY]

If no directory is specified, it uses the current directory.

Currently, it obtains a list of all jpeg files (specifically, files matching *.jpg) in the directory and shows them in slideshow. Use PageUp/PageDown, Left/Right, and Up/Down to go to the previous/next image in the list. The list circles around at both ends.

To drag the image (only possible when scrollbar(s) present), press down the main mouse button somewhere on the image, move the mouse, and let up the button.

pexec.pl: snippet runner
on Oct 14, 2006 at 20:30 UTC
by Hue-Bond

I'm very lazy. When I'm at the monastery, I hate to open an $EDITOR just for pasting that small snippet, saving it to a file ("Overwrite?" yes, of course) and then run it. So what I usually do is run perl at the shell prompt, and paste there. This has the drawback that, to modify it, I have to copy-paste part of it, change something and copy-paste the rest. And when the output of the program is so large that my terminal runs out of buffer space, it is lost. These problems notwithstanding, I'm very fond of this way of doing things since that's how I began using Perl. Just type, do a Ctrl-D and see the action!

This Gtk2 program has a text box in it, and a "Run" button. Just paste the code there, and click the button (or hit Alt-R). The output of the code goes to pexec.pl's STDOUT, so it has to be executed from a terminal. Snippets are run under -t to encourage good programming habits without standing in the way.

Lists in Gtk2 example
on Mar 07, 2006 at 17:42 UTC
by zentara
UPDATE Mar-07-2006: I made some mistakes with this cellrendererspinbutton, due to my upgrading to Perl-5.8.8, without getting the latest Gtk-Perl module ( Gtk-1.116 ). So I am changing the spincell renderer back to a correct package. If any of you experience the custom-cell renderers acting funny, or not working, in the Gtk-perl/examples directory, and you are using Perl 5.8.8, upgrade your modules.

Hi, setting up lists in Gtk2 is alot trickier than in Tk, but they are worth it. There are a whole series of "Simple::List" and "Ex" modules, which take the hassle out of Gtk2 lists, but they don't work well with Customized cells, like if you want a spinbox of real values, a progessbar, date selector, textboxes, buttons or a special kind of popup in a cell. So this is how it is done. There are some catches.

I link the toggle button with the icon displayed, but don't check that they match when initing the list..... it's just a demo.

So you can select which columns you like, and just copy out the column-code-sections to your app, and you should be able to make any list you want.

There are currently some other Custom Cell Renderers available, in the Gtk2-Perl module examples directory. Like a progressbar, date calendar popup, and complex popup. There is a section on how to make your own custom cell renderer in "perldoc Gtk2::CellRenderer", but it is not for the light hearted. :-)

Finally, I added some code to the spinbutton cell renderer package, which will set the value in the list, with any "focus-out" event, the drop-down cells require that you click somewhere in the list to set the new value. To get this feature in the drop-down list, a custom cellrenderer would need to be written for that cell.

This is one of the complaints people have about Gtk2, that you must attend to all these details to do things which are commonly done in Tk. But the Gtk2 developers have decided that their job is to make the underlying system very configurable, and leave it to the module designers to make the 'Simple' and 'Ex' modules which takes care of the commonly wanted features.

Gtk2 Visual Grep
on Jan 19, 2006 at 19:33 UTC
by zentara
This is a visual grep written using Perl/Gtk2. It uses File::Find to search for keywords, then displays results for easy "copy&pasting". I use it as a snippet browser, when I'm looking for code snippets in my library, but only remember a keyword to search for. Here is a screenshot The theme I'm using is at Z-theme

UpDATED: Jan20,2006 A small bugfix and code cleanup

Updated Jun 27,2012 Added unicode character support with the utf8::all module. Comment out these changes if you run into difficulties with too many utf8 errors. I also added a decode routine for input strings on the commandline. I havn't tested this extensively yet, but you should be able to pass in a unicode string as ARGV[0] and search for it. Also added -CS perlrun options. For instance you should now be able to run vgrep 'the ś character' and it should decode ś properly. Also I added a hack to the File::Find sub to find filenames with extended characters in them. So vgrep n zzśzz will find a file with that extended character string in its filename.

Updated again: Jun30, 2012. I cleaned up decoding of @ARGV, so that all inputs are decoded to unicode. I also fixed a little bug where filenames were being double-decoded as unicode and throwing a warning.

Updated again: Jul 01, 2012. This is becoming a little tutorial in unicode hacking. :-) Anyways, this update fixes an obscure bug with the interaction of Gtk2 and utf8::all. It all centers around why I needed to still manually decode @ARGV, even though the utf8::all module does this. As it turns out, from just experimentation, is that the use utf8::all line must come AFTER the GTk2 module declarations. WHY? Don't know. The result of this change allows me to remove the manual decoding of @ARGV, as well as the removal of the -CS perlrun option. This bug was finally fixed in the Glib source code.

Updated 27 Feb 2013: Fixed a small bug where binaries, like pdf's, were not found while doing a name search.

ServerApp
on Dec 28, 2005 at 21:10 UTC
by qbxk
Encapsulate and make-simple all the things you need to write your program as a mini-web-server-and-application - deliver your GUI to a local (or remote) browser
simple text editor
on Nov 05, 2005 at 01:10 UTC
by cosecant
This is a simple text editor I wrote in Perl using Tk and Tk::DialogBox
ztk-mapper
on Sep 30, 2005 at 21:45 UTC
by zentara
Pops up a Canvas on which you can draw maps or diagrams by dragging the mouse. Right clicks allow entering text. Will export the map to postscript. The window can be resized to size canvas. Undo mistakes with a middle-mouse click.
Tk-applause-meter
on Sep 25, 2005 at 21:25 UTC
by zentara
A recent node asked about doing this. This runs on linux with the alsa sound drivers, and ecasound effects program, which has a utility called "ecasignalview", which is a text mode loudness meter. I hacked it's output into a big tk meter (almost fullscreen). The spacebar toggles it's functioning, and it will hold the peak value in a text indicator, until it resets at 0.
ztk-tvguide
on Sep 15, 2005 at 15:39 UTC
by zentara
Perl/Tk frontend to the xmltv listings available from http://labs.zap2it.com. screenshot

Download: Download

UPDATE: ( 5 hours after post) I fixed a small bug which could cause cross-linking of entries across days. I had to undef all shared hash values before each run. So please download again.

UPDATE2: I found a bug in my UTC to localtime conversion. So I switched from UTC time. Please download again it if you are testing it, and notice any time listing errors. I'm the only one testing this, and I update the tarball as I notice, find and fix the bugs. :-)

marbles
on Sep 09, 2005 at 02:04 UTC
by liverpole
Years ago (before I started learning Perl), I created a "bouncing ball" program in C, which displayed balls which randomly bounced left or right each time they hit a "peg".  My brother, a 5th grade teacher, started using it to teach his class about probabilities and statistics, and was always amused that they found it hard to believe the outcome would always be the same -- a "bell-shaped" curve.  I just recently rewrote the code in Perl, which will let my brother demonstrate it for his classes using Windows (rather than be constrained by Linux).  It will run under both, but Linux requires that the Tk module be installed first, of course.

Let me know if you have any questions, and I'll be more than happy to explain.

ztk-roller-coaster-simulation
on Aug 09, 2005 at 18:03 UTC
by zentara
There was an "advanced perl programming" weekly contest awhile back( now defunct I think". One I entered was a roller coaster simulation. The original contest had various *.rc files to make any kind of coaster track design. I just included a nice one in DATA, to make the script self-contained.
ztk-BBC-World-News-Rss-TickerTape
on Aug 07, 2005 at 18:05 UTC
by zentara
This grabs the rss for various BBC World News Service news feeds. It will launch the link associated with the scrolling text in mozilla, by left clicking the scrolling text with the mouse. A right-mouse-click will allow you to select a new channel.
Plot a 8/16bit wav file with Win32::GUI
on Jul 27, 2005 at 01:00 UTC
by true
I had to turn off strict for the local $\ to work correctly, but this perl program will visually plot an 8bit wav and a 16bit wav mono or stereo. It also lets you listen to the wav and updates a progress bar as it is playing. You can also resize the GUI window which resizes the plot graph also. I added this snippet as thanks for the help i got in this thread.
Perl/Tk front-end to mplayer
on Dec 23, 2004 at 17:36 UTC
by zentara
This is just a way of viewing mpgs within a Tk window. There is alot of complexity in the way mplayer handles stdin and 'slave' mode, and this was the best I could do, without alot of detailed programming. Run this in a directory full of mpg videos, mp3's, or avi's. Hitting the Next button will let you breeze thru the directory as a sampler.

Update Sep 1,2006 Added .flv files to assist in playing Youtube.com downloads, as shown in YouTube Video Downloader

Newtons-Cradle-Tk-Zinc
on Dec 18, 2004 at 19:17 UTC
by zentara
Here is a "Christmas Toy" for your desktop. It is a Newton's Cradle, the swinging "momentum-conserving ball bearings". This particular script uses a "mouse-drag" to select balls, for more realism. It was designed as a visual simulation, and dosn't use any "real physics" in the calculations. :-) An explanation of the physics can be found here.
Hierarchical Todo List
on Nov 26, 2004 at 16:02 UTC
by Anonymous Monk
This is a Tk-based hierarchical Todo list keeper. At work I would always keep a simple text file with a list of things to do. As I continued to neglect them, and as the tasks got more complicated in structure, I felt a need to have a GUI for this stuff; however, none of the Linux-based GUIs I knew of had the functionality of organizing tasks in a tree. Anyway, instead of finding a good one, I thought I'd learn Tk by making this.

You can add and delete items by right-clicking on things and choosing from a menu. Use the arrows to change order of things. If an item text begins with "(!)", it will be highlighted. If it begins with "(wish)", it will be grayed out. Unfortunately, there is not much freedom in moving items around, except for changing order.

By default, it stores the created list in ~/.todo.txt. Take a look at the file - it's very simple and human-readable, so you can still use it with any regular text editor.

Be gentle on my coding practices - this was written a while ago; and some things I am simply stubborn about :).

tk-download-w-progressbar-wget
on Oct 18, 2004 at 16:24 UTC
by zentara
A few people have asked recently how to do a download in Tk, that won't block the GUI and has a download indicator. Well there are a few ways to do it. This one uses Tk::ExecuteCommand to run wget. It will download multiple files with separate indicators. You modify the wget command to do "resumes", "no-clobbers", or if you want to test on a local machine, you can -set-limit to throttle the download. Just look for the wget line, for examples. It hasn't been thoroughly tested, but works for me, and should give you an idea on how to get at the sub-widgets of ExecuteCommand. It also contains a little trick to give a variable-width icon for displaying progress when iconified. The wget method is nicer than using lwp, since it allows for resuming incomplete downloads.
zicons-Tk-Icon-Selector
on Oct 07, 2004 at 20:13 UTC
by zentara
Qumsieh's response in Button graphics for Tk prompted me to make a little programmer's helper, for selecting icons and cut-&-pasting them into your code. Please read the LICENSE since these are TCL ICONS from ICONS

I have just put them into a convenient form for selecting and pasting into your code. This file has over 600K of icons. It is available at zicons

screenshot

BathCalc 2.0
on Sep 01, 2004 at 20:27 UTC
by ~~David~~
Utility to calculate chemical concentrations and bath pour up volumes. Written using Tk. Thank you PerlMonks for all of the help!
ztk-enchat encrypted server client
on Aug 31, 2004 at 22:47 UTC
by zentara
Well here is another server-client pair using Tk and Net::EasyTCP. This has a more featured server than the one I posted earlier at Tk encrypted echoing-chat client and server. It has a font selector, and some security measures to prevent hacking at the port if on the internet. It stores it's latest configuration in __DATA__ (like a homemade Inline::Files :-) ).

Here is a screenshot and the README.

Downloads:

linux

windows

ztk-babel client server game with chat
on Aug 23, 2004 at 19:41 UTC
by zentara
A 1 to 4 player word game, with realtime encrypted chat. Words can be diagonal, row, or column. A set of dictionary files are included. Written with Perl/Tk. Client and server. Tested on my LAN, but should work on a dialup. Here is a screenshot It generates a random board for each game, ( trying to avoid infringement with another well known game ;-) ).

Works on Linux and Windows.

Downloads:

Linux Version

Windows Version

ztksearch
on May 09, 2004 at 16:28 UTC
by zentara
This is a pure perl search and display app using Tk. I use it to browse my perl snippets. Here is a ztksearch screenshot

It uses File::Find to recursively search directories, and filter thru text files for an exact match on a word or phrase. I don't slurp the files, but process the files line by line, stopping the file search after the first match. So multiline matches are missed.

The screen is updated in realtime, so you can start viewing the first return, while the search continues. I didn't spend too much time on formatting output, so man pages may have "clutter", but are still readable.

Tk-swish
on May 02, 2004 at 20:11 UTC
by zentara
This is a little Tk app for quickly browsing the results of a swish search. I use it as a fast Perl snippet searcher. To be honest, I think swish misses some of the results as compared to grep, but it's fast.
CamelTrouble
on Apr 07, 2004 at 05:44 UTC
by mawe
You like Action-Games?
Forget Doom, Quake, Solitaire and Mahjongg! Here comes CamelTrouble ;-)

As you will see, my perl skills are.. let's not talk about it :-/ I think there are some bugs (one I know occurs when you collect the monks). If you have the time, please give me some advice how to improve the code, I'd love to learn from your comments :-)
Have Fun!

Update:Fixed winning detection as PodMaster suggested
Update:Fixed some typos (thank you Albannach)
Update:Fixed monk-collection-bug with help from Vautrin and hossman

Win32::GUI::Carp
on Apr 05, 2004 at 00:05 UTC
by bbfu

Inspired by CGI::Carp and it's fatalsToBrowser option, this module attempts to do the same, but for GUIs. It is based on Tk::Carp, also by me but uses Win32::GUI.

pEdit v0.8 Beta release
on Mar 29, 2004 at 19:52 UTC
by Elijah
This is the newest release to pEdit which was already released to perlmonks a few weeks ago. This newest release has many improved features such as group indention addition and removal, group commenting and un-commenting, added "undo" and "redo" features, new parameter passing function while running scripts, and some new menu layout for better feel.
ztkdb-sql
on Mar 20, 2004 at 13:45 UTC
by zentara
A Tk GUI database system using thumbnails, SQLite, Postgres(and MySql untested). Features an "auto-text-save" using md5sums kept in the database. Also has an "auto-timestamp" on text entries.

It's big, so please download it from my site. Screenshot: screenshot Version with sample photos: ztkdb-sql-demo.zip Version with just bare neccesities: ztkdb-sql-basic.zip

Tk-GNU-Go
on Mar 11, 2004 at 10:02 UTC
by mawe
This is just an improved (?) version of the great GUI for GNU Go from gri6507. Hope he (and some others) like it.

BUGS: white stones aren't displayed on 19x19-board, first white move isn't shown in listbox, ...

TODO: clear bugs (please help me :-))

pEdit
on Mar 05, 2004 at 18:45 UTC
by Elijah
pEdit is a full blown programming environment/text editor. It has many basic functions users have come to expect from a text editor. This is written exclusively in Perl for Perl programming. Some highlights include keyword coloring and custom bindings. pEdit also contains a front end syntax checker and script running capabilites from within the program itself.
A simple words memorization tool
on Feb 24, 2004 at 12:12 UTC
by bhappy
Perl is not the only language i'm learning right now, i'm also learning english ;)... i was looking for a little tool, which would stay on the top of my desktop and show english words with a translation changing them in every N seconds. i'm using FlashKard, coming with KDE, and i have alredy collected a little vocabulary. so i decided to make a script which would use a file created by FlashKard (xml) and show words randomly.
don't judge it too strictly, it's my first public code.
i would be happy to get any notices, corrections or additions.
Simple Calculator using Tk
on Feb 19, 2004 at 17:57 UTC
by eoin
Just a simple calculator made using Tk; It was a refresher in Tk, god knows I needed it. Its my first posted code so don't be too harsh.
ztkdb
on Feb 08, 2004 at 20:05 UTC
by zentara
Perl Tk GUI using HList and Storable for making a general purpose "small" database. It fetures photos and thumbnails. It's available with some sample photos at ztkdb-demo.zip and just the code at ztkdb-bare.zip Here is a screenshot

UPDATED Mar-06-2004 : Fixed a nasty memory leak which left old Photo Objects uncollected.

Countdown
on Dec 25, 2003 at 14:11 UTC
by batkins
This is a simple Tk script to countdown the days, hours, minutes, seconds, and milliseconds until a particular event. It requires Tk, DateTime, and Time::HiRes.

The script creates a window in the upper-right corner of the screen and displays the countdown information there.

Have fun.

Update: Upper-left

Project Timeline Generator
on Dec 13, 2003 at 22:16 UTC
by CombatSquirrel

This code is a "quick" (6 hours or so) hack to generate a project timeline.

It supports six descriptive elements for every task (task, description, start, end, coordinator, group) and its output is largely customizeable. Settings as well as project trees can be saved and loaded, project trees can be loaded by drag'n'drop.

Known bugs/weaknesses: Only supports five different colors for task lines on different levels, lacks user message boxes ('File could not be saved', 'File not saved yet, do you really want to open file "foo"?', ...), task order cannot be changed without deleting tasks after they are created (however, the generated files are Data::Dumper files {yes, I know, XML is a lot better -- go on and implement it and then /msg me ;-)} and can be easily modified by hand), and it is not really 'user friendly'.

Update: I should have mentioned that dates are in standard European dd.mm.yyyy format. On the other hand, that's kind of obvious from the code and you can set everything on the nice Tk::DateEntry widgets anyways.

Scrolling-text-launchbar with Tk::Zinc
on Nov 25, 2003 at 20:06 UTC
by zentara
I originally started out to see how I could use the moving group feature of Zinc to make scrolling text. Then I added some rotated button groups, with indicator lights. Each button has a top and bottom sub associated with it, and a red-green indicator. The scrolled text was easy, but there is a subtle trick. You would think that you can get the length of the scrolled text with length($string), but in X, the pixel width varies, so you need to use bbox on the $text. Otherwise scrolling is simple...just move the entire group to the left, and when bbox is zero, reset the group position. Screenshot at scroller bar There is a min of 8 buttons, only so the texthelp won't mask the buttons, but if you change to balloons for help that wouldn't be a problem. I just tried to cram as many features as possible in a small space. :-)

There are just beeps in the subs now, but you can use your imagination....fork&exec some apps, import text into the scrollbar from a socket.....I'm still working on it. :-)

Zinc: TripleRotatingWheel
on Nov 01, 2003 at 23:17 UTC
by zentara
I recently posted a zinc demo which had rotating hands on 3 wheels at Gambling Game

Well, the question came up, why not just rotate the wheels? So here it is, it shows the true speed and power of Zinc. screenshot

Edit, BazB use square brackets for link to the other node.

Tk::Zinc Gambling game
on Oct 31, 2003 at 01:20 UTC
by zentara
In case any of you havn't checked out Tk::Zinc yet, here is a demo. I took the "WheelofFortune" demo, included with Zinc, and made a little game of it. I made 3 inter-related wheels, which can let you win a single,double,or triple. It probably could be used to make a slot-style machine. :-)
Make decoration-less windows in TK, and not lose functionality.
on Aug 24, 2003 at 16:39 UTC
by wombat
Some discussion went on recently about how to make decorationless windows in TK. The answer of course is to use the popular $mw->overrideredirect(1); function. However this was determined unsatisfactory because it prevented the window from being moved about the screen.

Well, I solved that.

All it is is that you make a border of widgets around the screen of whatever you want, and use the geometry function on the main window to move it about. Use the pointerxy construct to find out where the cursor is. Have fun!
PerlMan - Perl/Tk based pod pick/view
on Aug 23, 2003 at 03:26 UTC
by graff
perldoc pod/man page viewer

Adapted (very loosely) by David Graff, from example code that came with a perl-Tk distribution. Assumes a unix or linux system running X (so we can spawn separate xterms for multiple man pages to run in the background).

update: (shortly after initial post) fixed indentation and line wrapping.

Perl/Tk 3X3 Matrix Solver
on Jul 05, 2003 at 03:40 UTC
by PERLscienceman
I was reading through nodes and found one on Matrices (reference Node ID 267624 "Code to solve Matrix Formation Puzzle"). It reminded me of a little TK app. that I put together that solves a user input 3X3 Matrix. The code is in the early stages of my experimenting with Perl/Tk. I am certain that in some areas (like 'About' dialog box creation) it could definitely stand for some improvement; but that is what life and learning are about. So... here it is. Any feedback is greatly appreciated.
Win32::Start Perl/Tk Script Without Annoying DOS Window
on Jul 03, 2003 at 23:48 UTC
by PERLscienceman
Have you ever wanted to run a Perl/Tk Script on Win32 without that pesky DOS window? This is the script. I found this in O'Reilly's Perl Cookbook, 1st Edition; Section 15.17, pp544-545. With a little tweak (their was an apparent typo in the book which caused it initially not to work). This script allows for an associated process, in this case, yourTKscript.pl, to run without a DOS window. I found this script to be quite useful.
Gtk+ Run Program
on Jun 06, 2003 at 13:49 UTC
by coldhawk
This is very simple Gtk+ GUI program. like the name says run a program...
Tk Canvas Items Drag
on Jun 03, 2003 at 08:44 UTC
by msemtd
An example of draggable canvas items that I developed as a learning exercise. Quite often I find that I don't understand other peoples' examples until I have built my own from scratch. Here, I was looking for the information available from Tk during a drag type operation and to discriminate between objects upon drop. I threw in the playing card for eyecandy!
Tk MineSwooper
on May 30, 2003 at 11:13 UTC
by msemtd
A minesweeper clone written in my spare time for fun over a period of months and as a replacement for the Windows version. I enjoyed playing the famous ptkmines but found it to be a bit slow and, besides, I wanted to be able to describe the minesweeper logic in Perl myself! I developed a lightweight grid on a canvas and built it from there. I want to add a self-playing/solving feature in the near future. I'm sure its choc-full of bugs -- feel free to fix them!
WSpanel
on May 06, 2003 at 21:55 UTC
by strredwolf
Cheezy all-Perl/TK panel, with swallow support and a monitor applet built in. Documentation of the .wspanel.rc item there. Needs alot of cleanup, alas, but I got tired of the Gnome/KDE panels getting in the way.
PDE -- Perl Dev Env
on Feb 09, 2003 at 23:02 UTC
by tremere
The beginnings of a Perl/TK Development Envirment. I will update this as things get better... (I'll clean it up a bit aswell)
perlTk Type Tutor - useful for learning a DVORAK keyboard layout
on Jan 26, 2003 at 11:20 UTC
by PodMaster
A primitive (for the time being) typetutor. You click keys on your keyboard, and they light up on the screen.

Has a menu option for switching the virtual keyboard representation to/from QWERTY/DVORAK but it doesn't work. Thanks to JaWi

Activity timer / chess clock
on Nov 04, 2002 at 16:07 UTC
by rinceWind
This is my first Tk application. It can be used by contractors and consultants, out in the field for keeping track of the number of hours worked on various activities.

By defining the activities "White" and "Black", this program can be used as a chess clock.

Gtk::Sprite
on Oct 27, 2002 at 13:55 UTC
by jepri
Sprite is a module to bring back the simple graphics programming of the C64 (hopefully without the lookslikearse component). You can declare pictures to be 'sprites' on the canvas, and then move them around and crash them into each other.
A Tk::Wizard Framework
on Jan 17, 2002 at 00:56 UTC
by dhable
This is my first attempt at writing a robust Perl library and I would like some honest feedback on how I could make this better. It's mainly a class that creates a GUI wizard control in Tk.
Server Status Monitor
on Jun 24, 2002 at 16:35 UTC
by xjar
Just a simple server status monitor written in Perl/Tk. Run as root, or with root priveledges on a *nix system for ICMP ping to work. Works on Win32 as well.

Probably not the cleanest or well thought out code in the world, but that's why I'm posting it. I wouldn't mind getting feedback on ways to clean up parts of it, specifically I'd like to rid myself of $serverCount. I've done some fiddling, but haven't as yet been able to do this.

I've kept all comments in just in case my code is so bad in places as to be difficult to understand (which I don't think it is, but you never know) :)

UPDATE: Added user customizability for color settings and refresh rates on the server list (program has to restart for refresh rate change to take effect). Have yet to add grinder's suggestion to use sockets instead of Net::Ping.

UPDATE: Switched from Net::Ping to IO::Socket to determine if a server is alive or not. Thanks for the idea grinder!

UPDATE: Small fixes including adding a Port listbox, and aesthetic alignment of subwindows.

GNOME Panel Applet SSH Menu
on Jun 07, 2002 at 14:26 UTC
by grantm
Update: I have since re-implemented this functionality (with configuration dialogs) using Gtk and Ruby. It's available here.

Warning: Don't use this script as an example of how to write Gtk GUI code in Perl - it uses the old 'Gtk' API (which was current in 2002 when I wrote the script) not the more modern Gtk2 API.

This script scratches a particular itch of mine - I'm administering multiple hosts and regularly want to open a new SSH session to a particular host in a new window. This script provides the list of hosts as a drop-down menu.

It's my first attempt at a GNOME panel applet so I'm interested in feedback from Perl-Gtk gurus who spot unduly complex bits. I'm posting this because I didn't find much in the way of sample code on the web.

I'm running RedHat 7.3 and Ximian GNOME so if it doesn't work for you, you may need to upgrade to the latest versions. The only module I needed over and above RH+Ximian was XML::Simple, but I had that already :-)

Ultimately, I want to implement a configuration dialog but it's functional now so here goes ...

WxBrowser - a wxPerl HTML Browser
on May 06, 2002 at 14:42 UTC
by crazyinsomniac
A crude HTML Browser written using wxPerl. More of a minimalistic demo than anything. Nice layout IMO (a hint of things to come).

If you want the GOBAR at the bottom, just ## switch these two lines, the wxBOTTOM or wxTOP don't matter
$sizer1->Add( $sizer3, 0, wxGROW|wxTOP, 0 );
$sizer1->Add( $sizer2, 1, wxGROW|wxALIGN_CENTER_VERTICAL, 0 );

ptknotes
on Apr 19, 2002 at 21:13 UTC
by strredwolf
Sticky notes in Perl/Tk. Crude but effective. Hit 'new' to make a new note, 'saved' to show all notes you've written and closed. Saves in ~/.ptknotes
Perl/Tk Lights Out
on Dec 03, 2001 at 19:25 UTC
by Rhose
Not having used the grid geometry manager in Tk, and not having included pod documentation (redundant), I threw together this version of the Tiger Elctronic's Lights Out game to play with both concepts. I would appreciate any comments on the code (suggestions for improvement would be great). I am also interested in comments on this dumb habbit I picked up -- creating all my GUI objects in a hash array.
Tk based game
on Nov 08, 2001 at 18:08 UTC
by Aighearach
This is a little stress reliever I wrote in mid September 2001. It is a useful demonstration of basic Perl/Tk programming, including Pixmaps, mouse events, text, and window placement. May be slightly buggy in windows, I don't remember.

Edit (davorg): Title changed

The GUI Loft--A Win32::GUI Design Tool
on Aug 27, 2001 at 22:14 UTC
by jplindstrom
The GUI Loft is a powerful and easy-to-use WYSIWYG design tool for designing Win32::GUI Windows.

There is a User Manual, a Programmer's Reference, Demo code, and a support mailing list.

The code is around 300K and changing a lot, so I won't post it here, but you can download the source and binary at the home page: http://www.darserman.com/Perl/Loft

After designing the window in The GUI Loft, this is what the Perl code looks like to bring it into your program:

use Win32::GUI; use Win32; use Win32::GUI::Loft::Design; my $fileWindow = "fetch.gld"; #You created this using The GU +I Loft my $objDesign = Win32::GUI::Loft::Design->newLoad($fileWindow) or die("Could not open window file ($fileWindow)"); my $win = $objDesign->buildWindow() or die("Could not build window ($fileWindow)"); $win->Show(); Win32::GUI::Dialog();

I hope you'll like it!

/J

Tk::Style
on Aug 14, 2001 at 12:04 UTC
by Petruchio
Tk::Style implements stylesheet support for Perl/Tk, allowing one to separate presentation details from one's code and reduce the number of redundant parameters supplied to methods.

Update - Thu Aug 16 18:24:38 EDT 2001
Version 0.4 uploaded. Merely aesthetic changes since 0.2, API changes since 0.1; check the POD for details.

Tk::Carp
on Aug 14, 2001 at 02:46 UTC
by bbfu

Module to allow easy viewing of warnings and errors from a console-less Perl/Tk program.

From the POD:

When Perl programs are run in a GUI environment, it is often desirable to have them run with no console attached. Unfortunately, this causes any warnings or errors to be lost. Worse, fatal errors can cause your program to silently disappear, forcing you to restart the program, attached to a console, and hope you can reproduce the error.

This module makes it easy to see any errors or warnings your console-less program might produce by catching any errors and/or warnings and displaying them in a pop-up dialog box using Tk. It is similar in spirit to CGI::Carp's fatalsToBrowser and warningsToBrowser special import directives.

Update: Version 1.1; fixed some bugs, added some interface features.

Update: Version 1.2; Added some more features, and changed how the module works with regards to Tk::Error.

WebPic Beta
on Jun 25, 2001 at 23:35 UTC
by djw
** update ** I fixed a small typo in the thumbnail sub and a small error in my html tags. djw - June 27/01. Sorry if the code format is off a bit, I was testing out Komodo as an editor.

You can find the latest and greatest version at my site. You can find win32 binaries of Tk as well as html examples of output.

WebPic Beta
================================

What it does:

Read in a directory of digital cam pics, scale them to whatever percentage you want(in multiples of 10), provide an option for descriptions, and write an html page for viewing pictures.


0.3.6 Changelog
***************
- removed all hard coded paths/names - added to options
- added html style types - cascade and thumbnails
- added some defaults for the options window
- added clear and cancel buttons to options
- added a help menu (this file) - will include more later

0.3.5 Changelog
***************
- finished options window
- added a new dir location option
- Added a scale value
- finished html output default

0.3.0 Changelog
***************
- Added GUI - too much to name, first real version


To Do:
  • Complete keyboard shortcuts and frame focus stuff for speedy use
  • No GUI option. eg: "# webpic.pl -nogui -scale 20% -dir /var/www/images -newdir pr0n" etc
  • add the option to not have descriptions (no gui mode only?)
  • thinking about a slideshow html style
  • Need to add html bg and font colors to the option
Generic Registry Editor
on Jun 22, 2001 at 23:19 UTC
by ralfthewise
The is a gui driven registry editor for network admins. It allows admins to create standard registry edits for workstation builds, maintenance, etc.
monitor.pl
on Jun 06, 2001 at 01:12 UTC
by xphase_work
A simple system monitor written in Tk, should be
cross-platfrom, but only tested on Solaris 2.7.
This is my first somewhat large app in Perl/Tk.
Any comments would be helpful.
pVoice
on May 29, 2001 at 15:13 UTC
by Jouke
pVoice is a speechapplication for disabled people who can't speak themselves. By only generating left and right mousebuttonclicks the whole application can be operated.

update: pVoice has grown so much that it's not possible to keep the code here updated. You can find the sourcecode of pVoice 2.x at opensource.pvoice.org. Binary releases (packed with ActiveState's PerlApp) can be found on www.pvoice.org.
The current pVoice does no longer use Tk for the GUI, but wxPerl instead

I'll keep the code updated in here, though pVoice 0.01 was posted in Cool Uses for Perl. For more backgroundinfo, look at http://www.pvoice.org

This is version 0.02.1
The current version is 2.1
Pic Thresher
on Feb 24, 2001 at 08:34 UTC
by ichimunki
Assists in rapidly sorting and "threshing" a heap of JPGs. Requires an RDBMS (set to postgreSQL, but easily changed) and Tk.

Images and RDBMS not included. :)
Module info viewer
on Feb 19, 2001 at 20:18 UTC
by TheoPetersen
Show module versions for a running program.

I wrote this window to help with debugging mysterious failures at customer sites. We send scripts and modules to our users, who install them locally. They also install updates from CPAN as recommended, but we sometimes find we are out of sync. This code can be added to any Perl/Tk program to bring up a window which displays the versions of all modules loaded by the program to that point. The information is displayed in a Text widget, which allows the user to cut and paste it easily into a mail message.

The enclosed wrapper program is trivial but serves as an example framework. I cut and pasted it from one of our apps (and noticed the old-style Frame menu bar along the way, hmmm). On re-reading I think the code that gets the version data is rather clunky; any suggestions?

gPOD
on Jan 04, 2001 at 22:05 UTC
by KM
As an exercise to do some Perl/Gtk+ without using Glade, I decided to create a Gtk+ POD viewer, gPOD. I have been using it for the last few days, and actually kind of like it, so I thought I would share. I have a growing TODO list for it (adding color text, saving as things other than text, saving prefs, etc...) so if you happen to use it, and like it let me know so I can give you updates.
So, use it, abuse it, give me some comments (here or email), suggestions, patches, screenshots, etc.. I plan to continue to work on this and build a decent app.

So far, I have only tested this with Gtk 1.2.8/Gtk-Perl 0.7004, and Helix Gnome.

process_killer.pl
on Dec 25, 2000 at 00:30 UTC
by Falkkin
process_killer.pl is a graphical process-management program. It uses the Tk module for GUI and currently delegates to the system's "ps" and "kill" commands for actual process management. It supports the signals TERM, STOP, CONT, INT, HUP, and KILL (if your system supports them all.)

In its current configuration, it runs on my Debian GNU/Linux box; others may have to tweak it slightly to get it to work on their machines. Check the source for more info. If there is any demand for a more portable version of this program, I'll work on it.

The latest version of this program, along with a screenshot and other information, will always be available at http://www.jenovaproject.org/software/process_killer/.

Update: somehow, the code I had posted here didn't make it to the page; I've re-added the code, so go ahead and take a look at it.

Gtk+ HTML Tree Viewer
on Sep 20, 2000 at 21:17 UTC
by mdillon

this is a rewrite of a utility i did for a job where i was using HTML::TreeBuilder and XML::XPath to parse and search normal HTML documents using the powerful XPath query language.

this utility uses HTML::TreeBuilder to parse an HTML document from a URL specified on the command line or from an internal browser location line and displays it as a Gtk+ Tree in a window. only subtrees with text nodes or anchors are expanded.

there are (simple) XPath queries displayed in the status bar that could be used to extract that node from the document (for example, by converting it to XHTML with HTML::TreeBuilder and then using XML::XPath, or by traversing the TreeBuilder parse tree and programmatically constructing an XPath parse tree).

it's probably not a bad example of simple Gtk+ GUI programming. more may be yet to come in the way of functionality (and comments).

this was written and tested against Gtk 0.7003.

there is support for using GtkHTML as well, if your installation is functional (mine was partially functional when i wrote the code, but stopped working after i upgraded from GtkHTML 0.4 to 0.6.1 and recompiled Gtk::HTML)

most recently updated: 24 Sep 2000

Webcam 0.2
on Jul 08, 2000 at 01:35 UTC
by Arjen
I created this program when I still lived back in the netherlands. I had a Webcam-II hooked up to my Linux machine and at that time there were not many good programs for webcams, so I created my own.

This program uses Stamp and vidcat as utilities to capture and textstamp the picture.

My original page for links to the above programs.

Cheers
finddata.pl
on May 31, 2000 at 20:45 UTC
by perlcgi
This cool utility is included as a mini-demonstation of
what is possible with Perl on Win32 using Win32::GUI.
This code, the associated database and bitmap may be downloaded from here
If anyone can figure out why the "Stop" button does not
work properly or how to read the individual items of each
column based on the index item clicked on then Jonathan would appreciate the input.
Also Jonathan will be happy to answer anybody's questions
about the code if he can.
"It was done on a trial and error basis ... definitely not written off the cuff and then worked properly.
It required some rewrites of course. ;] Anyway, have fun with the code and any experimenting you want to do on it."
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2019-01-20 17:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    After Perl5, I'm mostly interested in:
































    Results (347 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!