SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Jan 2004
    Location
    cambridge uk
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Displaying Images in perl GUI

    Hello,
    I have tried to post this in a couple of other forums but have not had any luck. Perhaps someone here could point me in the right direction.

    All I want to do is display an image in a perl widget gui I have made.

    The program I have made so far all works but I can't figure out how to show an image in the same way that I show text entry widgets and label widgets. For example, this is how I put label and entry widgets into the GUI:

    Code:
    my $lab = $frm_name -> Label(-text=>"Series Name:") -> grid();
    my $series = $frm_name -> Entry() -> grid();
    I may have done this wrong also as this is my first ever perl program... but so far everything seems fine.

    How do I show an image tho?

    THanks!
    Aerris

  2. #2
    SitePoint Member
    Join Date
    Mar 2008
    Location
    Germany
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Which Perl module are you using for handling images ? Can you provide some more of your Perl source code, so it could get seen as a whole ?
    STAR ENTERPRISE - Information Technology Is Our Universe !
    Consulting | Software Development | Services
    Internet: www.starenterprise.com - info@starenterprise.com

  3. #3
    SitePoint Member
    Join Date
    Jan 2004
    Location
    cambridge uk
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi sure here is the code so far. I am using Perl TK:

    Code:
    use Tk;
    my $mw = new MainWindow; # Main Window
    $mw->title("XML generator");
    
    # Create widgets
    my $frm_name = $mw -> Frame() -> grid();
    my $lab = $frm_name -> Label(-text=>"Series:") -> grid();
    my $seriesTitle = $frm_name -> Entry() -> grid();
    my $lab = $frm_name -> Label(-text=>"Program:") -> grid();
    my $programTitle = $frm_name -> Entry() -> grid();
    my $lab = $frm_name -> Label(-text=>"Number:") -> grid();
    my $reelNumber = $frm_name -> Entry() -> grid();
    my $lab = $frm_name -> Label(-text=>".WMV Filename:") -> grid();
    my $fileName = $frm_name -> Entry() -> grid();
    my $lab = $frm_name -> Label(-text=>"XML File Destination Folder:") -> grid();
    my $destFolder = $frm_name -> Entry(-text=>"C:/Files/Ingest/") -> grid();
    
    # Create buttons
    my $clearButton = $mw -> Button(-padx =>0,-activeforeground=>white,-activebackground=>blue,-text=>"Clear Form",-width=>20, -command =>\&clearFields) -> grid();
    my $previewButton = $mw -> Button(-padx =>0,-activeforeground=>white,-activebackground=>blue,-text=>"Preview XML",-width=>20, -command =>\&previewXML) -> grid();
    my $createButton = $mw -> Button(-padx =>0,-activeforeground=>white,-activebackground=>blue,-width=>20,-text=>"Create XML File", -command =>\&createXML) -> grid();
    #Text Area
    my $txt = $mw -> Text(-width=>122, -height=>25) -> grid(-rowspan => 5,-row => 0, -column => 1);
    
    MainLoop;
    and then there are the createXML and previewXML loops that run when the buttons are pressed.

    I just want to show a .jpg or a .gif above the top "series" label.

    Thanks!

  4. #4
    SitePoint Member
    Join Date
    Mar 2008
    Location
    Germany
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry, I read too late that you refer to a GUI and so use Perl TK, which I'm not experienced with (I assumed you want to write some CGI stuff to read in a binary file, do some modifications and display it on a HTML page).

    Hopefully someone else can assist.

    Have you tried the mailing lists at http://www.perl.org/community.html - I made good experiences with these lists, very helpful people there :-)
    STAR ENTERPRISE - Information Technology Is Our Universe !
    Consulting | Software Development | Services
    Internet: www.starenterprise.com - info@starenterprise.com


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •