KWSN Orbiting Fortress Forum Index KWSN Orbiting Fortress
KWSN Distributed Computing Teams forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Perl/Tk

 
Post new topic   Reply to topic    KWSN Orbiting Fortress Forum Index -> Ye Olde Help Scrolls
View previous topic :: View next topic  
Author Message
Mildew
KWSN ArchBishop
KWSN ArchBishop


Joined: 13 Oct 2002
Posts: 2615
Location: Sweden

PostPosted: Fri Aug 24, 2007 6:58 am    Post subject: Perl/Tk Reply with quote

Ok, so this hasn't got anything to do with distributed computing, but I'm sure at least one of you Ni!twits is a real Perl/Tk guru!

I want my script to ask the user for a textual input. I thought a good way to do this was by using a DialogBox widget and use something like this (basically stolen from the Perl/Tk manual):
Code:
$db = $mw->DialogBox(-title => 'Dis be da text entering box', -buttons['OK']);
$db->add('LabEntry', -textvariable => \$ze_text, -label => 'Enter your text here:', -labelPack => [-side => 'top'])->pack;


However, by default this only allows for one single line of text, and I want the user to be allowed to enter a lot more than that.
How can this be done???
Is there any way you can specify the number of lines in the textbox?

The only way a moron like myself can solve this task is by using a new Toplevel window that contains a frame in which you can enter text.
This makes the code look a bit weird since the code that draws the new window will not halt and wait for input. Instead you have to draw the new window and let that function complete, and then sort of "move" execution to the new window.
Back to top
View user's profile Send private message
JerWA
Prince
Prince


Joined: 01 Jan 2007
Posts: 1497
Location: WA, USA

PostPosted: Fri Aug 24, 2007 4:47 pm    Post subject: Reply with quote

http://www.lehigh.edu/~sol0/ptk/tpj1.html

Took me awhile to find an example, but that page documents making a rather complex input page that includes multi-line text that is processed. Hopefully it'll help you figure out how to do it. I like PERL, but I've never given it the time necessary to learn it.
_________________

Stats: [BOINC Synergy] - [Free-DC] - [MundayWeb] - [Netsoft] - [All Project Stats]
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
Mildew
KWSN ArchBishop
KWSN ArchBishop


Joined: 13 Oct 2002
Posts: 2615
Location: Sweden

PostPosted: Sat Aug 25, 2007 3:05 am    Post subject: Reply with quote

Ah, yes, the page shows an example of how to create a window with a textbox where you can put in text.
However, my problem here is that from the main program window I want to create a new popup window asking for information rather than to include a textbox in the original main window.
In the code of your main program you can open a Dialogbox widget, and the program will halt and wait for input, like a cin.getline statement in C will wait for keyboard input.
My problem is that the only Dialogbox that supports text in Perl/Tk that I have found only uses one line of text for the input.
I can create a new window that contains a text input like the one in the example page, but then that would not be a widget of type Dialogbox. If I from the main window program opens a new window that is NOT a Dialogbox, then the program will simply draw the new window and then continue with the next line of code, i.e. it will not stay and wait for input.

But thanks anyway! Very Happy
Back to top
View user's profile Send private message
Grizzly
Prince
Prince


Joined: 01 Jun 2002
Posts: 3136
Location: Creepy (Crawlley)

PostPosted: Sat Aug 25, 2007 3:58 am    Post subject: Reply with quote

Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked

Wots wrong with BASIC then ??

Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked Shocked

Gotta rest my brain cell now

Regds Grizz

PS - umm what was the question agin'
_________________
Oh Bugger Forgot again - or is it Oh Father Reboot again ?

Ps Grizz in his second childhood - but not his last !

Edihtor of the KoKC (excused spel;l checher'er)

AND NI !!! Tophat 10e

[img]http://www.katrinashome.com/grizzly_counter.php[/[url=http://www.katrinashome.com/] ][/url]
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Mildew
KWSN ArchBishop
KWSN ArchBishop


Joined: 13 Oct 2002
Posts: 2615
Location: Sweden

PostPosted: Sat Aug 25, 2007 4:05 am    Post subject: Reply with quote

There's nothing wrong with BASIC. It was working great in the 80's and it's working great now! Razz

Shouldn't uncle take his nap now?

Twisted Evil Twisted Evil Twisted Evil
Back to top
View user's profile Send private message
Grizzly
Prince
Prince


Joined: 01 Jun 2002
Posts: 3136
Location: Creepy (Crawlley)

PostPosted: Sun Aug 26, 2007 2:31 am    Post subject: Reply with quote

Mildew wrote:
There's nothing wrong with BASIC. It was working great in the 80's and it's working great now! Razz

Shouldn't uncle take his nap now?

Twisted Evil Twisted Evil Twisted Evil


OK - Eon mode on now ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ

Regds Grizz
_________________
Oh Bugger Forgot again - or is it Oh Father Reboot again ?

Ps Grizz in his second childhood - but not his last !

Edihtor of the KoKC (excused spel;l checher'er)

AND NI !!! Tophat 10e

[img]http://www.katrinashome.com/grizzly_counter.php[/[url=http://www.katrinashome.com/] ][/url]
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    KWSN Orbiting Fortress Forum Index -> Ye Olde Help Scrolls All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Optimized Seti@Home App | BOINC Stats