[ale] Gtk-Perl

Eric Anderson eric.anderson at cordata.net
Thu Nov 7 16:40:53 EST 2002


On Thu, 2002-11-07 at 15:06, cfowler wrote:
> > $dropdown->get_menu()->get_active()->child()->get();
> 
> Ouch!
... snipped ...
> Crank it out in Java Swing and use XML as your storage for data. 
> Provide a menu item to export the data as a CSV file.
> 
> It will run on any platform.  Sure perl will run on any platform but
> GTK+ will only be avliable on those platforms.
> 
> Just a suggestion no flames please but I saw that long syntax up there
> and was thinking wow! What a mess.

I agree with the mess. I haven't done much Gtk+ programming before, but
I wanted a quick little "hack" app so a bill doesn't get lost on my desk
then late payment.

Currently I was just using a category on Evolutions todo, but I thought
it would be nice to have a app that was a bit more dedicated to it.

Gtk+ seems to try to reuse existing objects alot. For example a
GtkOptionGroup is just a special container of a Menu. This is obviously
fine for code reuse in the library, but it seems they would have some
shortcut accessors to make working with it easier. Aka have a function
in GtkOptiopGroup called get_selected which just makes a call internally
to: $dropdown->get_menu()->get_active()->child()->get()

That would make it easy to use and have a lot of code reuse. I think
part of their thought is that people will use events a lot more than I
am on this app. Then each GtkMenuItem would kick off an event with the
value of the field as the data of the event. But my app is cheesier than
that so I was hoping for a simple $dropdown->get_selected() or something
simpler.

Anyway, I am using Glade ( and libglade ) to do most of the interface so
most of the interface code is real small anyway. Then I am using the
Persistant-Base module from CPAN to provide automatic persistence of my
objects. So total code of my app is not more than 300 lines. Not really
worth trying to be all platform independent and everything.

-- 
Eric Anderson

---
This message has been sent through the ALE general discussion list.
See http://www.ale.org/mailing-lists.shtml for more info. Problems should be 
sent to listmaster at ale dot org.






More information about the Ale mailing list