From: Steven S. <ssw...@su...> - 2002-07-02 00:11:48
|
Basically I want the equivalent of the pascal readln or perl $input = <STDIN>; from within a textbox. the Text() method does allow me to gain access to the information entered but does not tell me whether the information was committed to by the user. I don't want to use a button if I can get away with it. any ideas? --Steve At 06:03 PM 7/1/02, you wrote: >Uh-oh ... that's a tricky one as far as I remember. Never did it myself, I >only have dialogs where the user triggers something with a button anyway. If >you want to capture the enter key, I'm afraid you have to go with those very >much not trivial accelerators. There has been a recent posting about them, >if that doesn't help you, you should go back to the list and post a >follow-up question. > >cya >Harald > > > -----Original Message----- > > From: Steven Swenson [mailto:ssw...@su...] > > Sent: Monday, July 01, 2002 16:03 > > To: Piske, Harald > > Subject: RE: [perl-win32-gui-users] How do I read the information in a > > tex tbox? > > > > > > You assumed correctly :). However, the Text() method doesn't > > appear to > > return either a \r or a \n ... so how do I determine whether > > the user has > > in fact entered the data? > > > > --Steve > > > > > > At 05:14 PM 7/1/02, you wrote: > > >I'm assuming you want to get the contents of a text field, > > not text file ... > > >;-) > > >There is the Text() method, defined as a general function, > > i.e. should be > > >valid for all widgets. It returns all of a field's contents. > > If you want the > > >bit that's selected: > > > > > >($from, $to) = $Main->MyField->Selection() > > >$selectedText = substr ($Main->MyField->Text(), $from, $to - $from); > > > > > >I'm not too sure about special cases (what are the values of > > Selection() > > >when there is nothing selected, what if the selection > > includes the very last > > >character, do you have to adjust the values by one for each > > crlf etc), but > > >that's the basic idea. > > > > > >Have fun, > > >Harald > > > > > > > -----Original Message----- > > > > From: Steven Swenson [mailto:ssw...@su...] > > > > Sent: Monday, July 01, 2002 15:06 > > > > To: per...@li... > > > > Subject: [perl-win32-gui-users] How do I read the information in a > > > > textbox? > > > > > > > > > > > > Ok, This feels like a silly question. However the > > > > documentation I have on > > > > Win32::Gui does not seem to specify a method by which I can > > > > actually read > > > > the content of a text file. All select, selectAll do is tell > > > > me they are > > > > successful. And Change() is called for every > > character... so I hope > > > > someone can give me a hand. > > > > > > > > --Steve > > > > > > > > > > > > > > > > ------------------------------------------------------- > > > > This sf.net email is sponsored by:ThinkGeek > > > > Welcome to geek heaven. > > > > http://thinkgeek.com/sf > > > > _______________________________________________ > > > > Perl-Win32-GUI-Users mailing list > > > > Per...@li... > > > > https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users > > > > > > |