Hi, there are many ways to do this, but the Tk::Canvas is a good choice, since you want a background image. Otherwise, you will need to look at the "place" geometry manager to place entries onto an existing image.

Here is a almost fully working example. In case this is homework, I left out the image, so you will have to figure that out for yourself. (Hint: just look at perldoc Tk::Canvas for createImage. If you need to resize it first, look at Tk::Photo, or groups.google search for "Perl tk canvas image" ).

#!/usr/bin/perl -w use warnings; use strict; use Tk; use Tk::LabEntry; my $mw = MainWindow->new; my $vh = $mw->vrootheight; my $vw = $mw->vrootwidth; # Note that the 'virtual window' height and width are $vh and $vw # respectively, so we use those dimensions for our Canvas height # and width, and let the Canvas expand and fill in both x and y # directions. # my $canvas = $mw->Canvas( -width => $vw, -height => $vh, -background =>'blue', -takefocus =>0); # so canvas dosn't take focus on tab press $canvas->pack(-expand => 1, -fill => 'both'); #just for fun instead of gif image $canvas->createRectangle(100, 100, 150, 150, -fill => 'orange'); my %window; my $ypos = 0; foreach ('First', 'Last'){ $window{$_}{'obj'} = $canvas->LabEntry(-label=> $_); $window{$_}{'obj'}->Subwidget('entry')->configure( -background=>'yellow', -textvariable => \$window{$_}{'data'}, ); $window{$_}{'obj'}->configure(-labelPack=>[-side=>'left']); $canvas->createWindow($vw/2, $vh/2 + $ypos, -window=> $window{$_}{'obj'}); $ypos += 40; } $window{'First'}{'obj'}->focus; $window{'Ok'}{'obj'} = $canvas->Button(-text=> 'Ok', -command=> sub{ foreach ('First', 'Last'){ print "$_ , $window{$_}{'data'}\n"; + } exit; } ); $canvas->createWindow($vw/2, $vh/2 + $ypos + 50, -window=> $window{'Ok'}{'obj'}); MainLoop;

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

In reply to Re: Graphic Fullscreen Program ? by zentara
in thread Graphic Fullscreen Program ? by xoddam

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!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • 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, details, 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, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            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.