Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Small FTP Client with GUI

by zentara (Archbishop)
on Jul 27, 2007 at 11:51 UTC ( [id://629081]=note: print w/replies, xml ) Need Help??


in reply to Small FTP Client with GUI

I would consider making your Logo.gif a base64encoded entity, so the program would be more standalone.
#!/usr/bin/perl -w use strict; use Tk; use Tk::PNG; use MIME::Base64; #this method works as easy as it does, because #Tk needs it's images to be base64 encoded anyways, #use this to encode #my $file = shift; #open (FH,"< $file") or die $!; #my $photo = do {local $/; <FH>}; #my $content = encode_base64($photo) or die $!; #print $content; #don't forget to '' quote my $bunny = 'iVBORw0KGgoAAAANSUhEUgAAAB4AAAAjEAIAAABcJvHFAAAACXBIWXMAAAsSAAALEgHS3 +X78AAAD F0lEQVR42u1YL+yqUBj1vfcLbhY3C44is8BIREYSG9FoNBqNkok2aFhp2BhJDWyadCZN/i +lOGxan jRdOuRsPxl/f+23vJKfX7x6+73znu5dK5RviV9QPDMMwDIPP7/f7/X6XTWU0Go1Go06n0+ +l0PM/z PC91CNu2bduWZVmW5bLpjsfj8XgcBEEQBJPJZDKZZAw0n8/n8zkCGYZhGIYgCIIgFEt3OB +wOh8OA gKZpmqZlDDedTqfTKRnO933f95GVer1er9fz0BVFURRFxCR3QfyMQfv9fr/fDyLgOI7jON +mo419k JUkMBoPBYJCRNBrxdrvdbrco6qvVarVaIWdFpQO/5tIcFBbE4nQ6nU6nJIpHjlGlEklTFE +VRFDIa T32/3+/3+3jqHMdxHBcfB2sK6HFFURRFeb1er9crfksoNUrr0GvUfxGfnA+FmX+QALDItG +LDA6O2 pQyCJFkPqxMDK2p9LodOAhQaLRjfoKRGo2wObl3G8PoDsA0Gb5Q5oonjfSNKTh96AOh+u9 +1ut1uS FuZrONPJ7bJ06tA9TDDsD6QkCnDltEDRkV1Q9AnENyuk8hcyChkkcZKo5uv1er1er3S6cA +PkFXSx MQodPrXFg2zTEsVANhO2JNdEmVo80ub7K/lSDHPyLkNaXrVarVar2W46LMuyLFsKaZ7neZ +4nvwFR NGKeGjYajUajkXz9z+RLn8/n8/ms/ANIQXq5XC6Xy/v9fr/fvw3p9Xq9Xq9VVVVV9fF4PB +6Pokhc r9fr9Vr6s6Lf4dNpbS6/exQA3BHDt/fkPl3wwT85wlcEcrCHZyHO1tmOSl95iGLcQN80Td +M0jTa1 LMuyLF3XdV03TdM0zWaz2Ww2Xdd1XRenDlDHgTbtvj/ykMZpDm/6LpfL5XLBmGi32+12G6 +Th5RAA Pne73W63iwfGYFosFovF4kOZrtVqtVoN16TD4XA4HPAAKDp5yZUkSZIk1GGz2Ww2m91ut9 +vt0Mof lcfxeDwej7PZbDaboRFbrVar1SJfIsLdYZfn8/l8Pue3y1zyiH9VAMFElb5Yp/+PcvAbH/ +25ox5S PYYAAAAASUVORK5CYII='; my $mw = MainWindow->new(); my $image = $mw->Photo(-data => $bunny); $mw->Label(-image => $image)->pack(-expand => 1, -fill => 'both'); $mw->Button(-text => 'Quit', -command => [destroy => $mw])->pack; #my $content = decode_base64($bunny) or die $!; #print $content; #will print binary gibberish MainLoop;

I'm not really a human, but I play one on earth. Cogito ergo sum a bum

Replies are listed 'Best First'.
Re^2: Small FTP Client with GUI
by Perforin (Novice) on Jul 28, 2007 at 00:22 UTC
    THX for your feedback!
    I installed the TK-RemoteFileSelect and Iīll try it out :D
    The thing is I have to code my Perl for Windows, so i canīt install TK::PNG :(
    Thank you guys for the Tips :)




    Chef: What the hell are you supposed to be anyway?
    Mephesto: That's not important right now.
    Chef: No! What the hell is this little thing supposed to be? It doesn't look like anything.
    The Mayor: Chef, the turkeys!
      i canīt install TK::PNG

      You don't need Tk::PNG to encode a gif file. A gif file will work just fine in the script I showed, since gif support is built directly into Tk. Tk::PNG and Tk::JPEG should have come with ActiveStatePerl.

      The only reason I used a png, was I had the script handy.


      I'm not really a human, but I play one on earth. Cogito ergo sum a bum

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://629081]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (10)
As of 2024-04-18 12:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found