Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?


by zentara (Archbishop)
on Mar 20, 2004 at 13:45 UTC ( #338291=sourcecode: print w/replies, xml ) Need Help??
Category: GUI Programming
Author/Contact Info
Description: 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: Version with just bare neccesities:

It's big, so please download it from my site.
The Readme:
This is a general purpose small visual database using HList and Tk.
It can be used as a rolodex, dossier, teacher's aid, personnel manager,
or inventory control. It works with SQLite or Pg (and probably Mysql untested)

My aim was to make a general purpose graphical front end for data.
Backups are made everytime the program exits if using SQLite.

To set it up, create a 'pics' directory, with at least 1 pic
called admin.jpg and 1 called default.jpg.
Then put all your photos into pics, (accepts jpg, gif, and png).
The zip file includes these and some sample photo's to demonstrate
something like a teacher's class database. ( I used the Sport's Illustrated
models for my development work, but I've included some "copyright free"
photos for distribution :-)).

On first run, the pics are converted to jpg, resized for height,
and the thumbnails are created. The entry names are taken from the
photo names, but can be changed after setup. On subsequent runs,
the Storable db is read and loaded.

If you are using windows, you may want to disable the MeM monitor at
lines 45,46,47. I don't know if the fork works on windows.

You can select the db type you want to use at lines 50-55. It
uses SQLite by default, but I test it also with Postgres and it works

I tried to make it fast, and it is on my machine. I only create
1 "display widget combo" and just fill it in with selection data.

To avoid using the "quirky" up-down-left-right keys behavior of
HList, I let it be controlled by the mouse. The scrolling is smoother.
To scroll the HList horizontally, either use the scrollbar, or click
on the "name" entry box, or the <-- label above it. You should see
how it works.

It includes color coding of the entries, and you could sort by color code.
I will do that later, right now the sort is alphabetical, with the
admin always at the top.

You can change photo and/or thumbnail by right clicking on the main photo.

It's got alot of features, so play with the buttons. Let me know
any glitches you discover. I've only tested it on Linux.

The Help is unfinished, and the Advanced Search is unfinished.

I've tried to make this "idiot-proof" as opposed to full-sql capable.

When you want to enter or change data in the Entry boxes, click on it,
enter the data, THEN you MUST PRESS ENTER to change the database.
The ENTRY fields are submitted immediately.

Changes in the textboxes are made when you select another thumbnail,
exit, or do a new sql query, I've tried to implement an "auto-timestamp"
and "auto-save" feature using md5 checksums.
Whatever you enter, will be automatically saved, if the data has changed.

When doing sql queries, just hit ENTER to return everything.
The dates are in yyyymmdd format, so to search for people whose
birthday is less than 1989 you would enter
'where dob<19890000'

I spent alot of time making sure that the program didn't leak
memory. All widgets are reused. When you run it, the memory will
increase as you click on entries as their  data is brought in, but
it definitely "levels out" and memory is recycled for every sql search.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: sourcecode [id://338291]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (4)
As of 2021-06-13 09:27 GMT
Find Nodes?
    Voting Booth?
    What does the "s" stand for in "perls"? (Whence perls)

    Results (54 votes). Check out past polls.