Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / Perl / November 2003



Tip: Looking for answers? Try searching our database.

Pashua Aqua Dialogue GUI

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Gary Blackburn - 07 Nov 2003 03:03 GMT
Saw a link to Pashua (http://q41.de/downloads/pashua_en/) at Macintouch
today and thought you all might be interested. Pashua is an easy way to
bolt on Aqua-native dialogue boxes to a bunch of languages including
Perl. From the website;

"Pashua ist a tool for creating simple, but native Aqua GUIs for Perl,
PHP, Python, shell scripts and AppleScript. “Simple” means: It's
limited to dialog windows, and the number of different GUI widgets
available is currently limited to text input fields, password input
fields, checkboxes, radiobuttons, popup menus, combo boxes, separator
lines, open / save panels, text, as well as buttons. Values returned by
the dialog are processed and used to set variables in the calling
script."

I've downloaded it and checked out the Perl example; there's two parts,
a Pashua binary and a Pashua.pm module. Put Pashua.pm in @INC somewhere
and the Pashua binary in your OS X Applications folder and you're in
business. Data from the dialogue box appears in a Perl hash as a return
value from the module's "run" method. Nifty.

The topic of creating Aqua interfaces comes up on this list all the
time, and I know there's Camelbones and TK, but this seems like it'd be
a good choice for small programs because it's just stupid-simple.

Oh yeah, and it's freeware.

Disclaimer: I have no connection with the product or the programmer. I
just think it's cool! :-) Enjoy!
---
Gary Blackburn
gblackburn@mac.com
Chris Nandor - 08 Nov 2003 01:07 GMT
> I've downloaded it and checked out the Perl example; there's two parts,
> a Pashua binary and a Pashua.pm module. Put Pashua.pm in @INC somewhere
[quoted text clipped - 10 lines]
> Disclaimer: I have no connection with the product or the programmer. I
> just think it's cool! :-) Enjoy!

I have no connection either, but I did a quick review of the Perl code in
Pashua.pm on this list a couple of weeks ago:

<pudge-68A6C6.07472524102003@onion.develooper.com>

Signature

Chris Nandor                      pudge@pobox.com    http://pudge.net/
Open Source Development Network    pudge@osdn.com     http://osdn.com/

Jerry Rocteur - 09 Nov 2003 12:02 GMT
Hi,

Reading the list I discovered MacPerl, Mac::Glue etc.

I program in Perl on UNIX/Linux/Mac OSX  but have never done any GUI
stuff and thought it may be fun to try this out.

I've spent quite a bit of time searching the web but have not come up
with any Tutorials or high level information, I've read through the
perldoc on the modules but this is low level stuff I want to get my
hands dirty by trying stuff out ..

Are there any up to date documents for Mac OS X that I may read to get
my teeth into this ? I've noticed Chris Nandor's book but it predates
Mac OS X.

Thanks in advance for any leads to information to get my teeth into.

Jerry
Jerry Rocteur - 09 Nov 2003 12:29 GMT
Sorry.. When I said MacPerl I meant Mac::Carbon Mac::AppEvents etc..
not the Mac OS 9 MacPerl... Perhaps I'm still confused..

> Hi,
>
[quoted text clipped - 15 lines]
>
> Jerry
Thilo Planz - 09 Nov 2003 12:44 GMT
Hi Jerry,

> I program in Perl on UNIX/Linux/Mac OSX  but have never done any GUI
> stuff and thought it may be fun to try this out.

On Mac OS X, you should take a look at Camelbones.
It allows you to use the Mac's native GUI toolkit (Cocoa) from Perl.

http://camelbones.sourceforge.net/

Thilo
Jerry Rocteur - 09 Nov 2003 13:09 GMT
> Hi Jerry,
>
[quoted text clipped - 5 lines]
>
> http://camelbones.sourceforge.net/

Thanks Thilo but real programmers don't click, users click ;-))))))))))

Not to mention that I'm allergic to Visual This and Visual That ..

Seriously, I'm reading up on Mac::Glue etc and this is really what I
want, if only I found up to date Tutorial or book or primer..

I want to start up iTunes and extract my song list, load into MySQL
using DBD::mysql and then interrogate the Tables.. All from Perl.

Or write a Cocoa GUI to load user entered data into MySQL .. instead of
using a Web browser and CGI..

Perhaps I should go back to my CLI and CGI ;-))

Jerry
John Delacour - 09 Nov 2003 17:29 GMT
>  I want to start up iTunes and extract my song list, load into MySQL
> using DBD::mysql and then interrogate the Tables.. All from Perl.
>
>  Or write a Cocoa GUI to load user entered data into MySQL .. instead
> of using a Web browser and CGI..

Try this:

<http://cocoamysql.sourceforge.net/>
Chris Nandor - 09 Nov 2003 18:54 GMT
> Seriously, I'm reading up on Mac::Glue etc and this is really what I
> want, if only I found up to date Tutorial or book or primer..
>
> I want to start up iTunes and extract my song list, load into MySQL
> using DBD::mysql and then interrogate the Tables.. All from Perl.

Well, there are examples in ex/ in the Mac::Glue distribution, which give a
lot of information.  Also, a fairly extensive, though dense (and assumes
some understanding of Apple events or AppleScript), explanation of Mac::Glue
is given in the supplied docs.  Anything more, feel free to ask specific
questions here.  For example, to extract song data, you can do:

  use Mac::Glue ':glue';
  my $itunes = new Mac::Glue 'iTunes';
  my $library = $itunes->obj(library_playlist => 1);
  my $songs = $library->obj(tracks => glueAll);
  my @tracks = map { song_data($_) } $songs->get;
 
  sub song_data {
     my($track) = @_;
     my @fields = qw(name artist album);
     my %info = map { ($_ => $track->prop($_)->get) } @fields;
     return \%info;
  }

Now @tracks contains a (possibly very large, if your library is as big as
mine :-) list of all your tracks.  You may wish to instead loop over
$songs->get and put one track into MySQL at a time, and this would integrate
quite easily with DBI + DBD::mysql.

Signature

Chris Nandor                      pudge@pobox.com    http://pudge.net/
Open Source Development Network    pudge@osdn.com     http://osdn.com/

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.