Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
#!/usr/bin/perl -w # # pVoice # # For more information go to http://www.pvoice.org where you can # download a zipfile containing this file, the README and pvoicecommon +.pm # # See the mentioned README file for a little documentation # Since version 0.02.1 you also need pvoicecommon.pm, which is the obj +ect- # package. use Tk 800.017; use Tk::JPEG; # And on unix-systems it requires the system command 'play' to play th +e .wav # files, and on Win32 systems, it requires Win32::Sound for the same p +urpose. # # Author: Jouke Visser # Last modification: May 28, 2001 # # pVoice is free for personal use. # Copyright (c) 2001, Jouke Visser # # Changelog: # 0.01: First release # 0.02: Little bugfix (arrow-up on first position never showed up) # 0.02.1: OO-ified the whole thing and parametrisized as much as possi +ble. use strict; #--------------------------------------------------------------------- +--------- use pvoicecommon; # Configuration-stuff my $pv = new pvoicecommon( program_title => "pVoice 0.02.1 development", bgcolor => 'white', active_bgcolor => 'red', sounddir => "./data", current_category=> "", current_page => 1, indexfile => "index.txt", catfile => "cat.txt", sound_ext => "wav", img_ext => "jpg", border_width => 10, cellpadding => 4, columns => 4, rows => 4, selected_button => 0 ); my $img_ext = $pv->img_ext(); $pv->next_img("volgende.$img_ext"); $pv->prev_img("vorige.$img_ext"); $pv->up_img("omhoog.$img_ext"); # Create the main window my $main = MainWindow->new(-background => $pv->bgcolor()); # Maximize the window my ($screenw, $screenh) = ($main->screenwidth, $main->screenheight); $main->withdraw(); $main->geometry($screenw."x".$screenh."+0+0"); $main->deiconify(); $main->raise(); # Write the title of the window $main->title($pv->program_title()); #create the window for the images $pv->mainframe($main->Frame(-background => $pv->bgcolor())->pack()); # Write the header $pv->mainframe()->gridRowconfigure(0, -weight => 0, -pad => $pv->cellp +adding()); my $label=$main->Label( -text => $pv->program_title(), -background => $pv->bgcolor()); $label->grid( -in => $pv->mainframe(), -column => 0, -row => 0, -columnspan=> $pv->columns() ); # Determine the maximum size of each icon $main->update(); # To determine the height of the $label the window mu +st be updated $pv->max_height(int( ($main->height() - $label->height())/$pv->rows +())- (2*($pv->border_width() + $pv->cellpadding()) )); $pv->max_width(int( (($main->width)/$pv->columns())- 2*($pv->border_width() + $pv->cellpadding()) )); #configure the grid to constant cellsizes $pv->configurecolumns(startcolumn => 0); $pv->configurerows(startrow => 1); # Read the categoryfile and draw the first page with category-buttons my @categories = $pv->readcategoryfile(); $pv->drawcatpage(\@categories); # Make the first button active $pv->buttons()->[$pv->selected_button()]->configure(-state => 'active' +); # Right mouseclick means select next item $main->bind('<Button-3>', sub { $pv->buttons()->[$pv->selected_button()]->configure( -state => 'normal'); if ($pv->selected_button() < @{$pv->buttons()} -1) {$pv->selected_button($pv->selected_button()+1)} else {$pv->selected_button(0)} $pv->buttons()->[$pv->selected_button()]->configure( -state => 'active'); } ); # Left mouseclick means execute current item $main->bind('<Button-1>', sub { $pv->buttons()->[$pv->selected_button()]->invoke(); } ); MainLoop();

In reply to pVoice by Jouke

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others pondering the Monastery: (9)
    As of 2014-07-31 08:36 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      My favorite superfluous repetitious redundant duplicative phrase is:









      Results (246 votes), past polls