GUI window


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting GUI window
# 1  
Old 01-12-2003
Java 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  
Old 01-13-2003
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!

Smilie Smilie
# 3  
Old 01-14-2003
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  
Old 01-16-2003
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  
Old 01-16-2003
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 ?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Toggle between xterm window and standard terminal window

Is it possible to toggle back and forth between an xterm invoked from one tty, and a shell invoked from a different tty? I am running Centos 7 with KDE and booting in non-graphic mode. After logging in on the default window (/dev/tty1) , I can then use ALT-F2 to access a new window (/dev/tty2),... (1 Reply)
Discussion started by: rhgscty
1 Replies

2. Programming

Python gui or C++ gui or java gui?

python gui or c++ gui or java gui? and when to use etch one? (1 Reply)
Discussion started by: kaja
1 Replies

3. Linux

Opening a GUI from a putty window on Linux

Hi, I have a linux which I am accessing using putty.I have written some code in TCL-Tk & developed a GUI based app.I knew that it is difficult to open a GUI based app. from putty,but there must be some way to do that. If anybody knows any such workarounds kindly let me know. Shell I am using is... (4 Replies)
Discussion started by: forstudy3
4 Replies

4. Red Hat

Maximizing X window without Window Switcher

Hi everyone! I have a strange situation. I'm running an NX remote Gnome desktop session. On the remote machine, there is a whole load of unsaved data in a window. A problem that I've been having with this NX session is that I can't load Gnome Applets, including the Window Switcher. So.. when I... (0 Replies)
Discussion started by: alexandicity
0 Replies

5. Red Hat

GUI help requir Every folder open in new Window..

I am using GUI mode in Linux & face a problem that when ever i double click on any folder it opens in new Window. I want to ask all DP members where is the option to disable this thing.. Means i want when ever i double on folder it should open in the same Window. looking for your help.. (1 Reply)
Discussion started by: salman103
1 Replies

6. Shell Programming and Scripting

Running a GUI without GUI

I was wondering if it is possible to run a GUI window (say Firefox) without actually showing up the window on the desktop but still make it do its own regular stuff (like maybe do something via the command line). Sorry if its a dumb question. Thanks (3 Replies)
Discussion started by: Legend986
3 Replies

7. UNIX and Linux Applications

Emacs GUI window, help.

I'm using xming and enabled x11 tunneling. But when I try to use emacs to get the GUI window. I do get the window, but no fonts, can't click on buttons like file, edit....and when I type anything I just get the black rectangles. I get error msg in terminal.... "Warning: Cannot convert string... (2 Replies)
Discussion started by: Bandit390
2 Replies

8. Shell Programming and Scripting

What to use for non-X GUI??

Has anybody ever needed to make a GUI (but really old-school style like dialog) to do some menu-based configurations... quite literally I have been bashing out code in Python using an interface class to the Dialog program in Linux... but it doesn't really have all the callback menu-driven... (0 Replies)
Discussion started by: jjinno
0 Replies

9. UNIX for Dummies Questions & Answers

If a is windows gui ( client), b is a unix gui ( Server for a) and c is a shell scrip

Hello all, 1) I want to have a GUI application that will call Unix shell scripts, 2) that GUI application should be able to reside on windows ( if possible) and then call Unix shell script either directly or through a server residing on unix. That is for example. If a is windows gui (... (1 Reply)
Discussion started by: hchivukula
1 Replies

10. Windows & DOS: Issues & Discussions

window 2000 professional not pinging my window 98 system.

Hello, We someone help me resolve this problem. I have window 2000 professional, windows 98 and Unixware 7.0.1 on the network. I was able to establish connection with all. However, l was unable to ping window 98 from window 2000 professional. I was able to ping the window 2000 from the window... (10 Replies)
Discussion started by: kayode
10 Replies
Login or Register to Ask a Question