f



"prompt" dialog for Tcl/Tk

Hey folks,

I noticed Tk has some handy default modal dialogs: tk_messageBox,
tk_chooseDirectory, tk_openFile, and so on.  One particular form of
dialog I would like to find - but don't know if it exists - is a
"prompt" dialog similar to a browser's native "prompt" dialog for
JavaScript, which pops up a modal dialog with a label, a single text
entry field, and "OK" and "Cancel" buttons, and returns the string
value of its entry field when the user clicks "OK" (or null if the
user clicks "Cancel").  Since browser makers have seen fit to include
this as a core native widget for the browser, I'd be surprised if Tk
didn't have something similar (before I go off & try building one on
my own).

Thanks,

David
0
davigoli (11)
5/10/2008 7:41:12 PM
comp.lang.tcl 23429 articles. 2 followers. Post Follow

2 Replies
628 Views

Similar Articles

[PageSpeed] 57

On May 10, 12:41=A0pm, David Golightly <davig...@gmail.com> wrote:
> Hey folks,
>
> I noticed Tk has some handy default modal dialogs: tk_messageBox,
> tk_chooseDirectory, tk_openFile, and so on. =A0One particular form of
> dialog I would like to find - but don't know if it exists - is a
> "prompt" dialog similar to a browser's native "prompt" dialog for
> JavaScript, which pops up a modal dialog with a label, a single text
> entry field, and "OK" and "Cancel" buttons, and returns the string
> value of its entry field when the user clicks "OK" (or null if the
> user clicks "Cancel"). =A0Since browser makers have seen fit to include
> this as a core native widget for the browser, I'd be surprised if Tk
> didn't have something similar (before I go off & try building one on
> my own).
>
> Thanks,
>
> David

Well, looks like I found an old thread that answered my question:

http://groups.google.com/group/comp.lang.tcl/browse_thread/thread/440b0f9263=
4cd989/20d2111d6f7ff4c4?lnk=3Dgst&q=3Ddialog#20d2111d6f7ff4c4

Thanks!
0
davigoli (11)
5/10/2008 9:31:33 PM
On May 10, 1:31=A0pm, David Golightly <davig...@gmail.com> wrote:
> On May 10, 12:41=A0pm, David Golightly <davig...@gmail.com> wrote:
>
>
>
>
>
> > Hey folks,
>
> > I noticed Tk has some handy default modal dialogs: tk_messageBox,
> > tk_chooseDirectory, tk_openFile, and so on. =A0One particular form of
> > dialog I would like to find - but don't know if it exists - is a
> > "prompt" dialog similar to a browser's native "prompt" dialog for
> > JavaScript, which pops up a modal dialog with a label, a single text
> > entry field, and "OK" and "Cancel" buttons, and returns the string
> > value of its entry field when the user clicks "OK" (or null if the
> > user clicks "Cancel"). =A0Since browser makers have seen fit to include
> > this as a core native widget for the browser, I'd be surprised if Tk
> > didn't have something similar (before I go off & try building one on
> > my own).
>
> > Thanks,
>
> > David
>
> Well, looks like I found an old thread that answered my question:
>
> http://groups.google.com/group/comp.lang.tcl/browse_thread/thread/440...
>
> Thanks!- Hide quoted text -
>
> - Show quoted text -

theres one in tklib
0
aaronf (28)
5/10/2008 11:49:51 PM
Reply:

Similar Artilces:

Looking for binary "expect" and "TCL/Tk" (if required) for OpenServer6
Does anybody know where to find "expect" (and related requirements) for OpenServer6? I can download the source files from nist.gov, but they do not compile. The MAN pages are already loaded on the system, so I suspect the programs would be on the distribution media somewhere. Any help would be appreciated. Thanks, Rick On 9 Feb, 17:57, Rick_Hoyle <motosl...@hotmail.com> wrote: > Does anybody know where to find "expect" (and related requirements) > for OpenServer6? I can download the source files from nist.gov, but > they do not compile. The MAN pages are al...

Are Tcl and Tk "inseparable"?
Hi, I am a Ruby user and probably I will have to use Tk in order to get nice GUIs. Now, the problem is that: Learning a new language (Ruby) is already time consuming enough. Do I have to learn also Tcl in order to use Tk? Can't I use Tk alone? (Umm, well, not so alone, together with Ruby, I mean) Thanks in advance. Surgeon schrieb: > Hi, > > I am a Ruby user and probably I will have to use Tk in order to get > nice GUIs. Now, the problem is that: Learning a new language (Ruby) is > already time consuming enough. Do I have to learn also Tcl in order to > use Tk? Can&#...

"Sayonara Tcl/Tk"
It seems that someone is really upset about Tcl/Tk. http://forum.sqlitestudio.pl/viewtopic.php?f=16&t=333 Στις 29/4/2013 11:49, ο/η saxo3800@gmail.com έγραψε: > It seems that someone is really upset about Tcl/Tk. > > http://forum.sqlitestudio.pl/viewtopic.php?f=16&t=333 > I think that he has a point regarding threads. George On Apr 29, 11:02=C2=A0am, Georgios Petasis <peta...@iit.demokritos.gr> wrote: > =CE=A3=CF=84=CE=B9=CF=82 29/4/2013 11:49, =CE=BF/=CE=B7 saxo3...@gmail.co= m =CE=AD=CE=B3=CF=81=CE=B1=CF=88=CE=B5: > > > It seems that someone is really upset about Tcl/Tk. > > >http://forum.sqlitestudio.pl/viewtopic.php?f=3D16&t=3D333 > > I think that he has a point regarding threads. Sure. Though I'm curious to know what specific problem of his is so much better served by explicit locks and shared vars than by message passing, given the context. It's not as if he was worried by lost nanoseconds in mutex contention. -Alex Στις 29/4/2013 20:07, ο/η Alexandre Ferrieux έγραψε: > On Apr 29, 11:02 am, Georgios Petasis <peta...@iit.demokritos.gr> > wrote: >> Στις 29/4/2013 11:49, ο/η saxo3...@gmail.com έγραψε: >> >>> It seems that someone is really upset about Tcl/Tk. >> >>> http://forum.sqlitestudio.pl/viewtopic.php?f=16&t=333 >> >> I think that he has a point regarding threads. > > Sure. Though I'...

"""""""""ADD ME""""""""""
Hi , Hope you are doing great. Please let me take this opportunity to introduce myself, Iam Karthik working with BhanInfoi Inc, a NY based company. We have consultants on our bench on various technologies, my request is to add me to your distribution list and kindly do send me the requirements. i have the below list available 1. Mainframe 2. Java 3.. Financial Analyst 4. Data Architect If there is any vendor ship agreement which has to be signed then I would like to take an opportunity to represent my company and expect your cooperation... ...

"Multithreaded" tcl/tk problem?
Hello In short: I ran into serious problems when developing multithreded Tcl/ Tk application in C. After spending (literally!) weeks on debugging and tests, I believe that it narrows down to Tcl/Tk bugs in multithread mode. I tried to find something over net on such problems, but to no success :-( I'll be very grateful if someone could confirm that, or perhaps point out what I'm doing wrong...here's detailed description: I have Win32 C++ application (SCADA/HMI program) which may contain several (from zero to literally hundreths) independent Tcl/Tk "modules". Module is my own term here, and it boils down to separate thread, with it's own tcl interpreter. I also create a "container window" in module's thread, and initialize Tk in this interpreter (via Tk_Init) so that "container window" becomes parent window for this Tk's instance "main window" (this is done via setting global "argv" variable to "-use container_id"). After initialization, thread load script from file into interpreter and enters fairly standard event loop, processing both windows messages and Tcl events. Some of messages (defined by RegisterWindowsMessage) are used to carry commands from other threads - when I receive such message I call some Tcl function in interpreter, by usual Tcl_Eval( "functionName" ) call. This code in turn does some Tcl work, like setting GUI up, displaying information for the user, sometimes i...

"or" and "and"
Hi, I'm just getting to discover ruby, but I find it very nice programming language. I just still don't understand how the "or" and "and" in ruby... I was playing with ruby and for example made a def to print Stem and Leaf plot (for those who didn't have a statistics course or slept on it, e.g. http://cnx.org/content/m10157/latest/) Here is the Beta version of it: class Array def n ; self.size ; end def stem_and_leaf(st = 1) # if st != (2 or 5 or 10) then ; st = 1 ; end k = Hash.new(0) self.each {|x| k[x.to_f] += 1 } k = k.sort{|a, b| a[0].to_f <=&g...

"out" and "in out"
Hi i found the following explaination: In Ada, "in" parameters are similar to C++ const parameters. They are effectively read-only within the scope of the called subprogram. Ada "in out" parameters have a reliable initial value (that passed in from the calling subprogram) and may be modified within the scope of the called procedure. Ada "out" parameters have no reliable initial value, but are expected to be assigned a value within the called procedure. What does "have no reliable initial value" mean when considering the "out" parameter? By c...

"my" and "our"
Hi, while testing a program, I erroneously declared the same variable twice within a block, the first time with "my", the second time with "our": { my $fz = 'VTX_Link'; .... ( around 200 lines of code, all in the same block) our $fz = 'VTX_Linkset'; ... } So the initial contents of the $fz declared with "my" is lost, because "our" creates a lexical alias for the global $fz, thus overwriting the previous "my" declaration. It was my error, no question. But I wonder why Perl doesn't mention this - even with "use s...

"/a" is not "/a" ?
Hi everybody, while testing a module today I stumbled on something that I can work around but I don't quite understand. >>> a = "a" >>> b = "a" >>> a == b True >>> a is b True >>> c = "/a" >>> d = "/a" >>> c == d True # all good so far >>> c is d False # eeeeek! Why c and d point to two different objects with an identical string content rather than the same object? Manu Emanuele D'Arrigo wrote: >>>> c = "/a" >>>&...

why "::", not "."
Why does the method of modules use a dot, and the constants a double colon? e.g. Math::PI and Math.cos -- Posted via http://www.ruby-forum.com/. On Oct 26, 2010, at 01:48 , Oleg Igor wrote: > Why does the method of modules use a dot, and the constants a double > colon? > e.g. > Math::PI and Math.cos For the same reason why inner-classes/modules use double colon, because = they're constants and that's how you look up via constant namespace. Math::PI and ActiveRecord::Base are the same type of lookup... it is = just that Base is a module and PI is a float....

about "++" and "--"
why this program snippet display "8,7,7,8,-7,-8" the program is: main() { int i=8; printf("%d\n%d\n%d\n%d\n%d\n%d\n",++i,--i,i++,i--,-i++,-i--); } > why this program snippet display "8,7,7,8,-7,-8" Ask your compiler-vendor because this result is IMHO implementation-defined. Check this out: http://www.parashift.com/c++-faq-lite/misc-technical-issues.html#faq-39.15 http://www.parashift.com/c++-faq-lite/misc-technical-issues.html#faq-39.16 Regards, Irina Marudina fxc123@gmail.com wrote: > why this program snippet display "8,7,7,8,-7,-8&q...

How to do PHP "require()" or TCL "source" in bash script
I'm sorry but I can't figure out how to explain this any better than this. In PHP we have a command "require()" that obtains a file and logically places it into another file. I cannot figure out how to do this in bash script as the requirement is necessary for a migration script to obtain the code from a .cfg file and then be able for the "parent" script to run the code it "imported" from the .cfg file, much like PHP's require() or TCL's "source". This is what I have so far and it fails: if [ -f ivc.cfg ]; then cat ivc.cfg fi Anyone...

Does it need a ";" at the very after of "if" and "for"
write code like: int main(void) { int a=10; if(a<20) {} } Compiler ok on dev-cpp . don't we have to add a ";" after if statement? marsarden said: > write code like: > > int main(void) > { > int a=10; > if(a<20) > {} > } > > Compiler ok on dev-cpp . don't we have to add a ";" after if > statement? The syntax for 'if' is: if(expression) statement There is no semicolon after the ) but before the statement. The statement is either a normal statement (which can be empty), ending in a semicolon:- if(expr) ...

"In" "Out" and "Trash"
I just bought a new computer and I re-installed Eudora Light on my new computer. But when I open Eudora, the "In", "Out" and "Trash" links are not on the left side of the screen the way they were on my old computer. How can I get these links back on the left side of the screen? Thank you. On 25 Mar 2007 09:49:22 -0700, "abx" <abfunex@yahoo.com> wrote: >I just bought a new computer and I re-installed Eudora Light on my new >computer. But when I open Eudora, the "In", "Out" and "Trash" links >are ...

"No installer way" to distribute tcl/tk?
Hi, I am writing a small app for the team as a utility. I uses Lisp and tcl/tk bindings. I have ActiveState tcl/tk 8.4 installed on my machine. Is there any way to distribute my app without having to install ActiveState package on every user machine? I am wondering if there is "minimum" way to distribute the necessary tcl/tk components (wish.exe, etc.). I mean just what dlls and exe should I put in my lisp app folder? Thanks! Andrew In article <1119284301.062794.27820@z14g2000cwz.googlegroups.com>, <astebakov@yahoo.com> wrote: >Hi, > >I am writing a small ap...

"Tk editor application template" [http://wiki.tcl.tk/8288]
I'm using Tk/Tcl 8.6.4 under WinXP Pro SP3 My learning style is to tweak something that is almost what I want until it is. I have three identified problems: 1. What is proper syntax to invoke when sourced from another script? [Works as expected when clicking on filename.] The code reads: #-------------------------------------------------- # Execute the main procedure #-------------------------------------------------- myAppMain $argc $argv However no reference to "argc" exists. 2. How do I add a functional "Find" com...

Using "source" vs "package require" for Tcl application files
I would like to divide my Tcl application into separate files. Should I generally use "source" to combine the files, or should I use the package mechanism (package provide, package require, etc.)? What is the generally accepted practice? Thanks, Gregg On 30 dec, 01:04, GB <g...@invalid.invalid> wrote: > I would like to divide my Tcl application into separate files. Should I > generally use "source" to combine the files, or should I use the package > mechanism (package provide, package require, etc.)? > > What is the generally accepted practice? > > Thanks, > > Gregg IMHO use [source]. My reasoning: - The package mechanism is meant for getting access to general-purpose libraries, installed directly under the Tcl installation. - You talk of source files for your own application. So I would expect these files to reside in a directory containing that application. Then [source] is easier to use - and you guarantee that you get the source files from your application (otherwise a random package with the same name from the installation could interfer, if you are not careful with the library path) - Using [source] also makes it clear that these files are meant for your application only, not for more general purposes. Regards, Arjen Arjen Markus wrote: > On 30 dec, 01:04, GB <g...@invalid.invalid> wrote: >> I would like to divide my Tcl application into separate files. Should I >> gen...

[tcl/tk] Question
Hi, I'd like to set the size of the "entry" field as long as the text entered. Any ideas? the line looks like this: set ent_top [entry .aaa.bbb.ent_top -textvariable TOP] On 09/08/2011 14:07, Guy wrote: > I'd like to set the size of the "entry" field as long as the text entered. > > set ent_top [entry .aaa.bbb.ent_top -textvariable TOP] Put a write trace on TOP that sets the -width of the entry. You might want to have a minimum and maximum though; zero-width entries are hard to use, and you don't want a width more than that of the screen (just in case someone cut-n-paste's War and Peace in there…) Donal. Am 09.08.2011 16:40, schrieb Donal K. Fellows: > On 09/08/2011 14:07, Guy wrote: >> I'd like to set the size of the "entry" field as long as the text >> entered. >> >> set ent_top [entry .aaa.bbb.ent_top -textvariable TOP] > > Put a write trace on TOP that sets the -width of the entry. You might > want to have a minimum and maximum though; zero-width entries are hard > to use, and you don't want a width more than that of the screen (just in > case someone cut-n-paste's War and Peace in there…) > > Donal. Why not use the built-in easy way: Just set the widget's -width option to 0. From the "entry" man page: "... If the value is less than or equal to zero, the widget picks a size just large enough to hold its current text.&...

Perhaps more eyecandy ("How to promote TCL/Tk" series...)?
I've installed recently xorg server V7.1, and examining the "eyecandy effects", which are available using "xcompmgr" utility, I noticed, that even the very basic settings, which I've found on Gentoo forum (for example: xcompmgr -cCfF -r7 -o.65 -l-10 -t-8 -D7) gave quite pleasant effect, when using Tk-driven programs. Although personally I'm not so big eyecandy-fan - I do realize, that most applications-users are very fond of such effects. So, my suggestion would be: perhaps could be possible to add some new options, which could allow such effects like "shadow" (below the window, or just pulled down menu), blur, shadow, opacity (I mean: some of the things to be found on the xcompmgr man page) - or perhaps even to open new toplevel with translucent background - just "by default", when xorg has been detected in environment? It's likely, that such direct support would mean less CPU usage. I don't know, how difficult to implement it can be (or whether is it possible at all) - it's just an idea. -- ZB ZB wrote: > I've installed recently xorg server V7.1, and examining the "eyecandy > effects", which are available using "xcompmgr" utility, I noticed, that even > the very basic settings, which I've found on Gentoo forum (for example: > xcompmgr -cCfF -r7 -o.65 -l-10 -t-8 -D7) gave quite pleasant effect, when > using Tk-driven programs. > > Although personally I'm n...

"?" in Tcl regexp
Any one can explain why I can not match the character "?" in Expect: expect -re "bala bala\?" Thanks, Dao "Dao" <youdao_du@hotmial.com> wrote in message news:bgt790$aca$1@zcars0v6.ca.nortel.com... > Any one can explain why I can not match the character "?" in Expect: > expect -re "bala bala\?" Backslash substitution in the quoted string is taking away the backslash for you; so the regexp you are using is "bala bala?" Put the string in braces instead of quotes. -- Jonathan Bromley, Consultant DOULOS - Developing De...

TCL "subshell"
Hi, I'm working on a kind of simulator /debugger application for some special multiprocessor hardware. The application has a number of TCL commands which the user can use to drive it. I'd like to implement breakpoints where the user can register TCL scripts to be executed when the breakpoint event is encountered. I really wanted to run these scripts in a "sub-shell" of the TCL environment which runs the main application. The reason for this is I want to provide a number of environment variables which can be accessed by the "subshell" but do not make sense int he main shell - for instance, the break point script could ask which process the breakpoint occured on, or the line number/file, ( there are a number of different things here which would only make sense to those involved in the development of the hardware). My first attempt was to use Tcl_CreateSlave(), but this doesnt "inherit" the commands from the main shell so doesn't work for me - in particular, the scripts registered for the breakpoints are not available in the slave. Does this "subshell" idea which makes sense in TCL or am I flogging a dead horse? dave In article <T66dnUaDisWokVXVnZ2dnUVZ_ofinZ2d@comcast.com>, CockneyWinker <datownsend@comcast.net> wrote: >Hi, > >I'm working on a kind of simulator /debugger application for some special >multiprocessor hardware. >The application has a number of TCL commands which ...

"Vectors" in tcl?
Hi all, What is my "best" alternative in handling vectors in Tcl? ("best" as in using a package available in ActiveTcl. I know about VecTcl, but...) I want to use a vector (potentially large, as in half a million boolean values). If this vector is created with all zeros, and I want to turn some of them (I have their indices as a tcl list) to 1. Right now I am using a tcl list, but I need to loop over this list, and set each one to 1. And I was wondering if there is a faster way (as in doing it with a single tcl command). I was looking at the the math:...

"How to Program in Tcl/Tk" A book written in Arabic from scratch
Hi. I am currently writing a book named "How to Program in Tcl/Tk". The explanation is completely in Arabic. I have started writing in 19 September 2013. I have completed now the 7th chapter about if-else and switch conditionals and while and for loops. The book will be embedded in an Android app to be sold later. I will announce in another message that the book is published once it's ready. Hi Rani, if you are looking for advice or suggestions, perhaps you can post an outline of the book here or on the Wiki. Anyway, it sounds like a great project. Regards, Arjen yes, of course Arjen Markus. I hope you are the same Arjen on Freenode's #tcl. You know we meet allot there. On Thursday, September 26, 2013 9:29:07 PM UTC+2, Rani Ahmad wrote: > yes, of course Arjen Markus. I hope you are the same Arjen on Freenode's #tcl. You know we meet allot there. :) True. On Thursday, September 26, 2013 5:44:15 PM UTC+3, Rani Ahmad wrote: > Hi. I am currently writing a book named "How to Program in Tcl/Tk". The explanation is completely in Arabic. > > I have started writing in 19 September 2013. > > I have completed now the 7th chapter about if-else and switch conditionals and while and for loops. > > The book will be embedded in an Android app to be sold later. > > I will announce in another message that the book is published once it's ready. Hi all. I just want to report that I finished...

Ann: Tcl/Tk "Universal" packages for Mac OS X
I've packaged "universal" installers of Tcl/Tk for Mac OS X (both the Aqua and X11 variants), and the Tile theming extension, for use on Mac OS X's PPC and Intel architectures. These builds are based on Tcl/Tk 8.4.13. Downloads and more information can be found at http://tk-components.sourceforge.net/installer/ Thanks. -- Kevin Walzer Poetic Code http://www.kevin-walzer.com ...

Web resources about - "prompt" dialog for Tcl/Tk - comp.lang.tcl

Resources last updated: 3/13/2016 12:51:16 PM