The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Hiding app window amessbee High Level Programming 1 12-05-2006 11:03 AM
getting url from mozilla window phani_sree High Level Programming 2 11-16-2006 02:23 AM
Where to get X window Libraries? byblyk Linux 3 10-02-2005 02:29 PM
window 2000 professional not pinging my window 98 system. kayode Windows & DOS: Issues & Discussions 10 11-13-2003 03:12 AM
about X-window serge High Level Programming 0 06-11-2003 07:43 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 01-12-2003
perleo perleo is offline
Registered User
  
 

Join Date: Aug 2002
Location: Ireland
Posts: 139
Post GUI window

Heres my script.

How do I put a picture in it?#util to show picture in window
#version 1.0
#-colinok

#make window with box for picture

use Tk;

my $mw = new MainWindow;

$scrollbar = $mw -> Scrollbar();
$text = $mw -> Text(-height => 20, -width => 50, -yscrollcommand => ['set' => $scrollbar]);
$scrollbar -> configure(-command => ['yview' => $text]);

$scrollbar -> pack(-side => 'right', -fill => 'y');
$text -> pack(-side => 'left', -fill => 'both');

MainLoop;
  #2 (permalink)  
Old 01-13-2003
WIntellect's Avatar
WIntellect WIntellect is offline
Registered User
  
 

Join Date: Sep 2002
Location: United Kingdom
Posts: 170
Perleo,

Again I pulled out my "Mastering Perl/Tk - O'Reilly" and found the quickest solution - place the image in a button:
Code:
$image = $mw->Photo(-file => "bigredbutton.gif");
$mw->Button(-text => 'Exit', -command => sub { exit },
                   -image => $image)->pack;
Obviously you need to change the "bigredbutton.gif" to the image file you wish to use; not to mention that I haven't included the usual "MainLoop" bits, etc.

Hope this helps - and I still recommend the book mentioned above!

  #3 (permalink)  
Old 01-14-2003
perleo perleo is offline
Registered User
  
 

Join Date: Aug 2002
Location: Ireland
Posts: 139
Yea, I ran out of money on my holidays so I couldnt buy it, but I should have it by June.

Anyway,

Is this right?
When I run it the perl window pops up and disappers and thats it.use Tk;

my $mw = new MainWindow;

$scrollbar = $mw -> Scrollbar();
$text = $mw -> Text(-height => 20, -width => 50, -yscrollcommand => ['set' => $scrollbar]);
$scrollbar -> configure(-command => ['yview' => $text]);

$scrollbar -> pack(-side => 'right', -fill => 'y');
$text -> pack(-side => 'left', -fill => 'both');

$image = $mw->Photo(-file => "refinery.jpg");
$mw->Button(-text => 'Exit', -command => sub { exit },
-image => $image)->pack;

MainLoop;
  #4 (permalink)  
Old 01-16-2003
WIntellect's Avatar
WIntellect WIntellect is offline
Registered User
  
 

Join Date: Sep 2002
Location: United Kingdom
Posts: 170
perleo,

Sorry you're having trouble, but your code worked PERFECTLY on both my Unix and Windows machines!

Are you getting any error messages?

Are you waiting long enough for the TK window to appear?

How are you starting the program?
  #5 (permalink)  
Old 01-16-2003
perleo perleo is offline
Registered User
  
 

Join Date: Aug 2002
Location: Ireland
Posts: 139
I got it, so how do i put text in the white box.

e,g i hit a button and text appears in the white box.


How do I do that ?
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:38 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0