xoddam has asked for the wisdom of the Perl Monks concerning the following question:

Hi, i have no idea hw hard is to programe what i want, and if it is too difficult please tell me. Well i was thinking about a pl program, that when you start it, IT goes FULL-SCREEN in resolution 800x600 for Example. And in this big Window there shall be a *.GIF as background (also 800x600 resolution so the quality is okay). And a small Window which asks you whats your first and second name. You write for example Oliver and than you press TAB and write you sure name :).. thats it .. (no mouse needed, only TAB :) ) How is it PerlMonks ? Are you able / and have time to help me ? :)

Replies are listed 'Best First'.
Re: Graphic Fullscreen Program ?
by marto (Cardinal) on Mar 19, 2007 at 13:30 UTC
        Well TIMTOWTDI :) I updated my node seconds before your reply pointing the user to other options.

        Thanks

        Martin
Re: Graphic Fullscreen Program ?
by zentara (Cardinal) on Mar 19, 2007 at 15:37 UTC
    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
Re: Graphic Fullscreen Program ?
by ww (Archbishop) on Mar 19, 2007 at 13:49 UTC
    And whether or not this is homework (label it that if it is and you will be less likely to be scorched), the basic ethos here is that we are happy to help folk learn, but decidedly unhappy about those who seek to have us earn their wages or their grades for them.

    So, the classic Monastery question, "What have you tried?" is shorthand for "you will get better answers if you show us you have put some of your own effort into the project."

    As to your multiple questions:

    1. "...hw hard is to programe... (sic)"
      Not at all hard or maybe, "too hard" -- depending on what you have learned about perl (and, in this case, as marto suggests, TK).
    2. "...too difficult..."
      See answer one if you are asking how hard it would be for you; see paragraph one if your question is how hard the wisest Monks would find this exercise.
    3. "...able..."
      assuredly.
    4. "...have time..."
      If that reflects a view that your time is more valuable than ours, probably not! On the other hand, even I am writing this in hopes that you will see your visits here as a chance to learn (not merely beg, borrow or steal, nor merely "cargo cult some code"). So then consider this a "warm welcome..." and you will do well to read the introductory material in the right sidebar and, especially, How do I post a question effectively?.

    Update ungarble some of my writing. Replacement or new matter is bold; replaced content is striken (as am I upon reading this after coffee).

      Yep as i taught :) well thats what i wanted, you know ... i searched and searched ... books etc .. and there vere only programms with source of +400 lines :) soo i wanted to be sure that i have to learna and wait a bit till i will able to do that :) Noone knows it could be like showimage!"reso>800x600"(adress) ok anyways :} ty for help