f



Tcl/Tk without script

Hi!

I am currently trying to write a Tk Gui for an existing C++ program.
As I am totally new to Tcl/Tk, I considered writing this gui without
writing a script, i.e. to create and handle the Tk Gui only via the C
API. Therefore I searched the internet for informations on how to use
Tcl/Tk in a way as you would use Qt, GTK or any other C/C++ GUI
toolkit. To my surprise, I didn't find any information on how to do
so. Trying to learn the stuff from the API I stumbled over the
nonexistence (or non-documentation?) of methods to create or handle
widgets from C/C++. My question is therefore: Is it for any reason
impossible or infeasible to employ Tk as a GUI without using a script?
Or, if not, could anyone give me a hint on where to find howtos,
tutorials etc.?
Sincerely,
            Moritz
0
take1 (6)
8/17/2004 12:56:09 PM
comp.lang.tcl 23429 articles. 2 followers. Post Follow

5 Replies
471 Views

Similar Articles

[PageSpeed] 3

take@informatik.uni-freiburg.de (Moritz Tacke) writes:

>Hi!
>
>I am currently trying to write a Tk Gui for an existing C++ program.
>As I am totally new to Tcl/Tk, I considered writing this gui without
>writing a script, i.e. to create and handle the Tk Gui only via the C
>API. Therefore I searched the internet for informations on how to use
>Tcl/Tk in a way as you would use Qt, GTK or any other C/C++ GUI
>toolkit. To my surprise, I didn't find any information on how to do
>so. Trying to learn the stuff from the API I stumbled over the
>nonexistence (or non-documentation?) of methods to create or handle
>widgets from C/C++. My question is therefore: Is it for any reason
>impossible or infeasible to employ Tk as a GUI without using a script?
>Or, if not, could anyone give me a hint on where to find howtos,
>tutorials etc.?
>Sincerely,
>            Moritz

Are you mad?

Create some script files. If you have special requirments that cannot
be expressed with script then create an extension and use that from
your script.

For example, a notepad-ish app:

 package require Tk
 text .t -yscrollcommand {.s set}
 scrollbar .s -command {.t yview}
 grid .t .s -sticky news
 grid rowconfigure . 0 -weight 1
 grid columnconfigure . 0 -weight 1
 proc OpenFile {} {
    set file [tk_getOpenFile]
    if {[string length $file] > 0} {
        set f [open $file r]
        .t insert end [read $f]
        close $f
    }
 }
 . configure -menu [menu .menu]
 .menu add cascade -label File -underline 0 -menu [menu .menu.file]
 .menu.file add command -label Open -underline 0 -command OpenFile
 .menu.file add command -label Exit -underline 1 -command {destroy .}
 tkwait window .


How many lines of C++ do you think you will need?

-- 
Pat Thoyts          http://www.zsplat.freeserve.co.uk/resume.html
To reply, rot13 the return address or read the X-Address header.
PGP fingerprint 2C 6E 98 07 2C 59 C8 97  10 CE 11 E6 04 E0 B9 DD
0
cng (142)
8/17/2004 1:35:15 PM
On 17 Aug 2004 05:56:09 -0700, take@informatik.uni-freiburg.de (Moritz
Tacke) wrote:

>Hi!
>
>I am currently trying to write a Tk Gui for an existing C++ program.
>As I am totally new to Tcl/Tk, I considered writing this gui without
>writing a script, i.e. to create and handle the Tk Gui only via the C
>API. Therefore I searched the internet for informations on how to use
>Tcl/Tk in a way as you would use Qt, GTK or any other C/C++ GUI
>toolkit. To my surprise, I didn't find any information on how to do
>so. Trying to learn the stuff from the API I stumbled over the
>nonexistence (or non-documentation?) of methods to create or handle
>widgets from C/C++. My question is therefore: Is it for any reason
>impossible or infeasible to employ Tk as a GUI without using a script?
>Or, if not, could anyone give me a hint on where to find howtos,
>tutorials etc.?
>Sincerely,
>            Moritz
Hi Moritz,
I understand your reasoning but you will want to use a script. It is
soooo much easier to create a GUI this way.
If this means anything to you: I have a strong C/C++ background and I
am working with Tcl/Tk now for about 4 years. I wouldn't dream of
going the way you are considering but rather try to convince anybody
in sight to build the GUI using plain Tcl/Tk. 
My route to go would be
- to turn the existing C app into a Tcl extension (meaning you can
call its function from Tcl),
- and from the GUI activate those functions.
Later, if this should be an issue, you can combine everything into a
single binary (this is called 'wrapping' in Tcl speak).
Just my 0.02
Helmut Giese
0
hgiese (1076)
8/17/2004 1:42:33 PM
Moritz Tacke wrote:
> Is it for any reason
> impossible or infeasible to employ Tk as a GUI without using a script?

Yes. Tk is designed to be used with a scripting language (Tcl is the
preferred language in this newsgroup, but others have been done too.)
Having all that basic infrastructure to build on makes Tk itself much
simpler than it would otherwise have to be.

However, we also have a freely available packaging technology whereby
you can build your script into the same executable as Tcl and Tk. And in
some places (and with some kinds of managers), it sounds better to
describe your script as a "configuration file" rather than a script in
some language, since you can quite rightly claim that Tcl and Tk are C
libraries... :^)

Donal.
0
8/17/2004 1:55:03 PM
Actually, there is a very good set of man pages, an HTML database, and a 
windows help file that describes th public interface to the Tk library. 
If you are familiar with modern GUI implementations, it is 
straighforeward to use the Tk API from C programs, and from C++ if you 
can keep your brain from liquifying over the use of const qualifiers.

On the other hand, doing things like:

static char *my_script = "puts \"Hello, world\"";

int run(Tcl_Interp *interp,const char *what) {

	char *p = strdup(what);

	int result = Tcl_Eval(interp,p);

	free(p);

	return result;
	}

.... run(interp,my_script);

can be used to bury the script in your program. Just replace the simple 
one with something that does it for you.

As the other respondents have noted, building the GUI with Tk script is 
much easier than using the API, but then, easy is for wimps...:)


Moritz Tacke wrote:
> Hi!
> 
> I am currently trying to write a Tk Gui for an existing C++ program.
> As I am totally new to Tcl/Tk, I considered writing this gui without
> writing a script, i.e. to create and handle the Tk Gui only via the C
> API. Therefore I searched the internet for informations on how to use
> Tcl/Tk in a way as you would use Qt, GTK or any other C/C++ GUI
> toolkit. To my surprise, I didn't find any information on how to do
> so. Trying to learn the stuff from the API I stumbled over the
> nonexistence (or non-documentation?) of methods to create or handle
> widgets from C/C++. My question is therefore: Is it for any reason
> impossible or infeasible to employ Tk as a GUI without using a script?
> Or, if not, could anyone give me a hint on where to find howtos,
> tutorials etc.?
> Sincerely,
>             Moritz
0
8/17/2004 1:57:07 PM
Thanks for your help! 
I am currently going the proposed way of using a script, and I've got
to confess that my fear of an all-new language with such an, ehm, kind
of unfamiliar syntax for the total newbie (which was in essence the
reason for considering to  do without a script and to stay within the
languages I know) was not justified. In fact, the building-up of the
GUI is surprisingly rapid, and the next step (the integration into the
program) doesn't seem too difficult. In any case: Thanks a lot!

                   Moritz

PS: Especially the "Are you mad?" from the first reply was very
convincing ;-)
0
take1 (6)
8/18/2004 8:01:41 AM
Reply:

Similar Artilces:

[TCL/TK interface] Passing variable to TCL/TK
Hi, I am trying to sent to a variable to tcl/tk and unify there it with a string. I wrote the prolog code: :- use_module(library(tcltk)). :- use_package(classic). go(A):- tk_new([name('Simple')], Tcl), tcl_eval(Tcl, 'source simple2.tcl', _), tcl_eval(Tcl, ['ask', br(write(A))], _), tk_main_loop(Tcl), tcl_delete(Tcl). and the tcl file simple2.tcl proc ask {var} { unify_term $var my_value } unfortunatelly when I query for go(S). the interpeter goes into a loop (!?). Where I am wrong. Are there any example code somewhere i...

Opening a TCL program from within another TCL program in ANSYS Tcl-Tk
Hi everyone, I have been pulling my hair with this one for a couple of days and still have not found a fix. I'm working within ANSYS Tcl-Tk implementation. I created a Tcl-Tk script that generates a simple window with three buttons. Each button opens another window which is created in a separate Tcl file. The second window have a lot of text entries, variables, procedures, etc. I can open the second Tcl file by itself and everything works as supposed, but when I open it using the button in the first window, it opens but any procedure called by the widgets on the second window are not found... Here's the deal... Since I'm working within the ANSYS implementation of Tcl-Tk, I'm actually using an ANSYS command to open the second window. The command I use is: ### ans_sendcommand ~eui,'source O:/mad_projects_2/ANSYS/Macros/ IBR_CAS.tcl' ### It actually sends a command back to ANSYS telling it to execute a Tcl command... I know this is not pretty but its the only way i was able to make it at least show the window. ############################## #Main Tcl (excerpt): ############################## namespace eval Tools { proc IBRCambpell {} { #source O:/mad_projects_2/ANSYS/Macros/IBR_CAS.tcl ans_sendcommand ~eui,'source O:/mad_projects_2/ANSYS/Macros/ IBR_CAS.tcl' } proc viewManager {} { ans_sendcommand ~eui,'source O:/mad_projects_2/ANSYS/Macros/ ViewManager.tcl' } proc powerAnnotation {} { ans_sendcommand ~eui,'source ...

Debugger for Tcl/Tk and [incr Tcl]
hi, where can i get Coverage for debugging tcl/tk, [incr Tcl] source? this tool is advised to use in 'Practical Programming in Tcl and Tk' or any other good debugger, which i could use? best, s. On Jan 23, 5:56=A0am, Sitaca <sit...@gmail.com> wrote: > hi, > > where can i get Coverage for debugging tcl/tk, [incr Tcl] source? > this tool is advised to use in 'Practical Programming in Tcl and Tk' > > or any other good debugger, which i could use? I see, at http://wiki.tcl.tk/8638 , a brief reference to the topic of coverage for tcl. I don't know whether or not any of the tools mentioned include coverage of itcl. On 23 jan, 12:52, "Larry W. Virden" <lvir...@gmail.com> wrote: > On Jan 23, 5:56=A0am, Sitaca <sit...@gmail.com> wrote: > > > hi, > > > where can i get Coverage for debugging tcl/tk, [incr Tcl] source? > > this tool is advised to use in 'Practical Programming in Tcl and Tk' > > > or any other good debugger, which i could use? > > I see, athttp://wiki.tcl.tk/8638, a brief reference to the topic of > coverage for tcl. I don't know whether or not any of the tools > mentioned include coverage of itcl. I have a more complete version of the coverage tool mentioned on that page. I just never got around to publishing it more widely. As for debuggers: the Wiki has a lot of pointers on that subject as well. Regards, Arjen Larry W. Virden wrote:...

Tcl command to evaluate a tcl script?
Hi all, I need to evaluate a separate tcl file within a tcl file. Is there any tcl command to evaluate a tcl file ? Regards, Prabu.K prabu wrote: > Hi all, > > I need to evaluate a separate tcl file within a tcl file. Is there any > tcl command to evaluate a tcl file ? > > Regards, > Prabu.K > hi, try: source your_other_tcl_file.tcl cheers, Tobi ...

Newbie to Tcl/Tk: Question about Tcl and VxWorks....
Hello All, I have tried looking on the offical tcl/tk website and also at WindRiver's without success. Please forgive my ignorance on this, but is tcl/tk available for VxWorks or is there in progress a port going on. Many thanks in advance, Richard "Richard Latter" <richard_l@latter.demon.co.uk> writes: > I have tried looking on the offical tcl/tk website and also at WindRiver's > without success. Please forgive my ignorance on this, but is tcl/tk > available for VxWorks or is there in progress a port going on. I have ancient Tcl 7.3 here, but don't know of newer ports. Donald Arseneau asnd@triumf.ca ...

Tcl command to evaluate a tcl script? #2
Hi all, I need to evaluate a separate tcl file within a tcl file. Is there any tcl command to evaluate a tcl file ? Regards, Prabu.K prabu wrote: > I need to evaluate a separate tcl file within a tcl file. Is there any > tcl command to evaluate a tcl file ? You're probably looking for the "source" command. Other commands of interest would be "package require" or "eval". The command "load" is for binary shared libraries. -- Darren New / San Diego, CA, USA (PST) Scruffitarianism - Where T-shirt, jeans, and a three-day beard are "Sunday Best." Thanks Darren. But what my need is that I am writing a tcl script which is going to take any tcl script as input and should return the output of the file. How can I do that? Regards, Prabu Darren New wrote: > prabu wrote: > > I need to evaluate a separate tcl file within a tcl file. Is there any > > tcl command to evaluate a tcl file ? > > You're probably looking for the "source" command. > > Other commands of interest would be "package require" or "eval". The > command "load" is for binary shared libraries. > > -- > Darren New / San Diego, CA, USA (PST) > Scruffitarianism - Where T-shirt, jeans, > and a three-day beard are "Sunday Best." On 17 Dec 2006 21:16:16 -0800, "prabu" <catchme.prabu@gmail.com> wrote: > Thanks Dar...

Incr Tcl /Tk for Tcl 8.4
Hi, I am trying to download incr Tcl and incr Tk for Tcl/Tk 8.4.19. I looked at: http://sourceforge.net/projects/incrtcl/files/%5BIncr%20Tcl_Tk%5D-source/3.4.1/ But only itcl seems to be there. And the CVS doesn't have the 3.4.1 tag. Do you know where I can get incr Tk and hopefully a corresponding iwidgets? Thanks, Andres On 5 Okt., 11:16, Andres Garcia <tclc...@gmail.com> wrote: > Hi, > > I am trying to download incr Tcl and incr Tk for Tcl/Tk 8.4.19. > > I looked at: > > http://sourceforge.net/projects/incrtcl/files/%5BIncr%20Tcl_Tk%5D-sou... > > But only itcl seems to be there. And the CVS doesn't have the 3.4.1 > tag. There is no tag for this version. But you can use a date. cvs -d :pserver:anonymous@incrtcl.cvs.sourceforge.net:/cvsroot/incrtcl -z3 co -P -D 2010-10-28 incrTcl > > Do you know where I can get incr Tk and hopefully a corresponding > iwidgets? Itk is inside itcl sources. cvs -d :pserver:anonymous@incrtcl.cvs.sourceforge.net:/cvsroot/incrtcl -z3 co -P -D 2010-10-28 iwidgets HTH rene Thanks. Andres >> I am trying to download incr Tcl and incr Tk for Tcl/Tk 8.4.19. >> >> I looked at: >> >> http://sourceforge.net/projects/incrtcl/files/%5BIncr%20Tcl_Tk%5D-sou... >> >> But only itcl seems to be there. And the CVS doesn't have the 3.4.1 >> tag. The released sources for Itcl 3.4.1 were not developed in SF CVS. SF CVS got abandoned during the January...

tcl/tk unicode wie kann man formel/math. zeichen in tk unter tcl anzeigen lassen?
Hallo, ich schreibe gerade an einen programm, dass auf windows unix und vielleicht auch anderen plattformen laufen soll. es sollen auch mathematische zeichen wie alpha 'm�' etc. dargestellt werden. mit welchen zeichensatz (vielleicht unicode) kann man dies realisieren? funktioniert es mit einen zeichensatz f�r alle plattformen unabh�ngig? English summary for the rest of the world: sven.rega@gmx.de would like to use mathematical symbols like "mu" in Tk applications. He asks if Unicode is the solution and whether that works on all platforms. I assert that Unicode works since Tcl 8.1 and that UCN syntax like \u00B5 is the way to go with symbols hardcoded in Tcl scripts. I point him to "charmap.exe" (Windows), "Character Palette" (Mac OS X) or generically to <http://www.unicode.org> to find out the Unicode code points. ---------------- Hi, Versuch doch bitte beim n�chsten Mal auf Englisch zu fragen, sonst kann Dir nur ein Bruchteil der Leute hier folgen. sven.rega@gmx.de (xfan) writes: > ich schreibe gerade an einen programm, dass auf windows unix und > vielleicht auch anderen plattformen laufen soll. es sollen auch > mathematische zeichen wie alpha 'm�' etc. dargestellt werden. mit > welchen zeichensatz (vielleicht unicode) kann man dies realisieren? Ja, das funktioniert mit Unicode in Tcl seit Version 8.1. > funktioniert es mit einen zeichensatz f�r alle plattformen > unabh�ngig? Das ist die ...

E.J. Friedman-Hill's Tcl/Tk Course
E.J. Friedman-Hill's Tcl/Tk Course Tcl/Tk Programming in Five Easy Lessons http://www.linbox.com/ucome.rvt/any/doc_distrib/tcltk-8.3.2/TclCourse/ I am unable to open the ppt files that seem very promising. Can anyone see what is the problem with them and can convert/fix so that I can open in the office 2007 or open office ? Thanks Bolega On 24/03/2011 2:51 AM, bolega wrote: > E.J. Friedman-Hill's Tcl/Tk Course > Tcl/Tk Programming in Five Easy Lessons > > http://www.linbox.com/ucome.rvt/any/doc_distrib/tcltk-8.3.2/TclCourse/ > > I am unable to o...

tcl-gaul: Genetic Algorithms for Tcl. (Tcl package)
This is an announcement for a relatively new Tcl project: tcl-gaul Tcl-gaul is a Tcl extension for genetic/evolutionary algorithm processing.It relies on the GAUL library: http://gaul.sourceforge.net/ * A genetic algorithm (GA) is a search technique used in computing to find exact or approximate solutions to optimization and search problems. Genetic algorithms are categorized as global search heuristics. They are a particular class of evolutionary algorithms that use techniques inspired by evolutionary biology such as inheritance, mutation, selection, and crossover. For an introduction to genetic algorithms visit: http://gaul.sourceforge.net/intro.html Platform: Linux (GAUL library dependency) Home page: http://sourceforge.net/projects/tcl-gaul/ Man page: http://tcl-gaul.sourceforge.net/ Author: Alexandros Stergiakis alsterg ...

tcl-pam: PAM authentication for Tcl (Tcl package)
This is an announcement for a relatively new Tcl project: tcl-pam Tcl-pam is a Tcl interface to the PAM* service of Linux. It provides a Tcl package that allows Tcl scripts to use PAM to authenticate users and programs. It relies on linux-pam library: http://www.kernel.org/pub/linux/libs/pam/ * PAM (Pluggable Authentication Modules): A mechanism to integrate multiple low−level authentication schemes into a high−level application programming interface (API). This enables programs that rely on authentication to be written independently of the underlying authentication scheme. Platform: Linux Home page: http://sourceforge.net/projects/tcl-pam/ Man page: http://tcl-pam.sourceforge.net/ Author: Alexandros Stergiakis alsterg ...

Dose there any tcl script to translate an file with embedded tcl
Hi I need to generate some big file, but there are rules for generate these files Ex . ============================== Start input a [0] wire input a [1] wire .. .. .. .. input a [1000] wire End ================================= Dose there any tcl script can help to translate a file with embedded tcl script into a new file For example this is a source file ======================== Start * set i 0 * for { set i 0 } { $i < 1000 } { incr i } { * puts input a [$i] wire * } End ========================== After Translate ======================= Start input a [0] wire input a [1] wire .. .. .. .. input a [1000] wire End ======================= Gogo12 wrote: > > Hi > I need to generate some big file, but there are rules for generate > these files > Ex . > ============================== > Start > input a [0] wire > input a [1] wire > . > . > . > . > input a [1000] wire > End > ================================= > > Dose there any tcl script can help to translate a file with embedded > tcl script into a new file > For example > > this is a source file > ======================== > Start > * set i 0 > * for { set i 0 } { $i < 1000 } { incr i } { > * puts input a [$i] wire > * } > End > ========================== > > After Translate > ======================= > Start > input a [0] wire > input a [1] wire > . > . > . > . > input a [1000] wire > ...

how to access prolog from tcl?(not using tcl/tk interface from prolog)
hi, I am now doing my thesis project relate to mobile agent technology which need to access prolog from tcl. There are a lot of prologs which have the function to access tcl from prolog, but I need to access prolog from tcl.(I can not use the method that first load prolog, then access tcl via the interface, and reload prolog). So is there any one can help me or give me some tips to solve this problem? Now I can only found one article to solve this problem(http://tkoutline.sourceforge.net/wiki/38). I tried the code, but unfortunately, the terminal always crashed and did not give any response when I run the second command of its example---"% prolog::init". I could run the command of "plcon -s interp.pl -t main -q" in DOS terminal without problem. Originally I thought it is the version problem of tcl, so I changed it from 8.4.9 to 8.0.3, but the problem was still there. My SWI-prolog version is 3.1.2. My operating system is winXP. I am now very nervous about that, Please give me some help to solve this problem, or tell me some other way to access prolog from tcl. Thank you very much I did not give up the solution of (http://tkoutline.sourceforge.net/wiki/38). Now I changed SWI-prolog version to 5.4.4. When I run the second command(prolog::init) of the example from wish.exe, it pop up a window, said that Prolog interpreter closed unexpectedly Prolog interpreter closed unexpectedly while executing "error "Prolog interpreter closed unexpect...

tcl-mmap: A POSIX mmap interface for Tcl. (Tcl package)
This is an announcement for a relatively new Tcl project: tcl-mmap Tcl-mmap is a Tcl interface to the POSIX mmap* system call. It provides a Tcl package that allows Tcl scripts to: 1) Memory map files for improved access efficiency; 2) Share memory between related processes; 3) Easily implement cyclic persistent log files. * See the mmap(2) man page. Platform: Linux/Unix Home page: http://sourceforge.net/projects/tcl-mmap/ Man page: http://tcl-mmap.sourceforge.net/ Author: Alexandros Stergiakis On Sep 3, 11:48=A0am, Alexandros Stergiakis <alst...@gmail.com> wrote: > This is an announcement for a relatively new Tcl project: tcl-mmap > > Tcl-mmap is a Tcl interface to the POSIX mmap* system call. It provides > a Tcl package that allows Tcl scripts to: 1) Memory map files for > improved access efficiency; 2) Share memory between related processes; > 3) Easily implement cyclic persistent log files. > > * See the mmap(2) man page. > Great to see this and the other packages you made. Looking at the manpage it looks a bit misformatted before the usage example. Any specific reason to use GPL for this instead the usual Tcl/MIT/BSD style license used? Michael schlenk wrote: > On Sep 3, 11:48 am, Alexandros Stergiakis <alst...@gmail.com> wrote: >> This is an announcement for a relatively new Tcl project: tcl-mmap >> >> Tcl-mmap is a Tcl interface to the POSIX mmap* system call. It provides >> a Tcl package that...

tcl-syslog: Unix system logging for Tcl (Tcl package)
This is an announcement for a relatively new Tcl project: tcl-syslog Tcl-syslog is a Tcl interface to the *nix syslog service. It provides a Tcl package that allows Tcl scripts to log messages to syslog. Platform: Linux/Unix Home page: http://sourceforge.net/projects/tcl-syslog/ Man page: http://tcl-syslog.sourceforge.net/ Author: Alexandros Stergiakis alsterg ...

tcl-mq: POSIX Message Queues for Tcl. (Tcl package)
This is an announcement for a relatively new Tcl project: tcl-mp Tcl-mp is a Tcl interface to POSIX Message Queues*. It provides a Tcl package that allows scripts to create/open/close/unlink multiple parallel message queues, and to send/receive messages synchronously and asynchronously to/from them. * A POSIX message queue is an Inter-Process Communication mechanism available on Linux and some other POSIX-compliant operating systems. It allows to or more processes (or threads) to communicate under the same OS. The messages are buffered by the kernel, which gives them kernel persistency. A message queue can be thought of as a linked list of messages. Threads with adequate permission can put messages onto the queue, and threads with adequuate permission can remove messages from the queue. Each message is assigned a priority by the sender, and the oldest message of highest priority is always retrieved first. Unlike PIPES and FIFOS, no requirement exists that someone be waiting for a message to arrive on a queue, before some process writes a message to that queue. It's not even a requirement for both processes to exist at the same time. Read mq_overview(7) for more details Platform: Linux Home page: http://sourceforge.net/projects/tcl-mp/ Man page: http://tcl-mp.sourceforge.net/ Author: Alexandros Stergiakis alsterg On Sep 3, 11:37=A0am, Alexandros Stergiakis <alst...@gmail.com> wrote: > This is an announcement for a relatively new Tcl pro...

Calling gnuplot from tcl\tk script
I have a problem which would benefit from plotting data assembled with a Tcl script. I'm told it should be possible to do an splot on a Tk canvas. I'm new to both Tcl and Gnuplot. I would appreciate pointers. thank you. On Jul 24, 5:11 am, Richard Owlett <rowl...@atlascomm.net> wrote: > I have a problem which would benefit from plotting data assembled with a > Tcl script. I'm told it should be possible to do an splot on a Tk > canvas. I'm new to both Tcl and Gnuplot. I would appreciate pointers. > thank you. yes you can with simple plot. Everything is explained in the help: gnuplot> help tk the major problem is that the tk terminal doesn't support continuous colors so if you try to use the pm3d stuff you'll get an error If you want to embedd the X11 window inside the tk window there is a patch that just does that but you'll need to recompile gnuplot from scratch tv wrote: > On Jul 24, 5:11 am, Richard Owlett <rowl...@atlascomm.net> wrote: > >>I have a problem which would benefit from plotting data assembled with a >>Tcl script. I'm told it should be possible to do an splot on a Tk >>canvas. I'm new to both Tcl and Gnuplot. I would appreciate pointers. >>thank you. > > > yes you can with simple plot. Everything is explained in the help: > gnuplot> help tk > > the major problem is that the tk terminal doesn't support ...

running a tcl/tk script on a Macbook
I've used Tcl/Tk for year under Linux. At the top of the script I always used something like: #!/usr/bin/wish gave the script execution permissions and could run things by directly typing the script name. However this doesn't appear to work on my Macbook. So far it behaves like it is just ignoring the #! line and trying to interpret the Tcl/Tk commands as sh commands. If I run my script as: wish fun.tcl all works. Any ideas how to run things the Linux way? Thanks in advance. bob On Sep 25, 5:06=A0pm, ican...@gmail.com wrote: > I've used Tcl/Tk for year under Linux. =A0 =A0At the top of the script I > always used something like: > > #!/usr/bin/wish > > gave the script execution permissions and could run things by directly > typing the script name. > > However this doesn't appear to work on my Macbook. =A0 =A0So far it > behaves like it is just ignoring the #! line and trying to interpret > the Tcl/Tk commands as sh commands. =A0 =A0If I run my script as: > > wish fun.tcl > > all works. > > Any ideas how to run things the Linux way? =A0 =A0Thanks in advance. > > bob Check if you really have a /usr/bin/wish, Mac OS X uses some pretty long pathes with all those Frameworks. And if you at it, consider installing something like ActiveTcl for Mac OS X because the Tcl 8.4.7 shipped by Apple is pretty outdated. Michael On Sep 25, 11:30 am, schlenk <schl...@uni-oldenburg.de> wrote: >...

Want Recommended Tcl/Tk Scripts
Hello All, I am writing a Tutorial on Tcl/Tk. It is available at http://www.geocities.com/binnyva/code/tcl/tutorial/index.html. At the end of the tutorial, I want to provide the readers with some good examples for Tcl/Tk programming. I thought that I could use some real life examples by provided scripts from around the globe that they could download and study. I have searched and got some script and their location but I thought that perhaps you would know of some good scripts. I would greatly appreciate if you could share it with me. Just give me the url of the script. Some necessary points to consider while choosing the script. * The code must be free. * The script should have a good and standard style for scripting in Tcl/Tk. * The said script must be cross platform. * Not extremely large. * Should be understood by beginners. Thanks for the effort Binny V A http://www.geocities.com/binnyva binnyva@hotmail.com (Binny V A) writes: > Hello All, > > I am writing a Tutorial on Tcl/Tk. It is available at > http://www.geocities.com/binnyva/code/tcl/tutorial/index.html. At the end > of the tutorial, I want to provide the readers with some good examples > for Tcl/Tk programming. I thought that I could use some real life > examples by provided scripts from around the globe that they could > download and study. > > I have searched and got some script and their location but I thought that > perhaps you would k...

Tcl/Tk scripts to windows executable
Dear All, I am writing Tcl/TK based GUI aplication and I am using packages like Iwidgets 4.0.2 in the scripts. When I am wrapping these scripts to Exe using Freewrap application, it is giving error. After refering some of the documents I have included lappend auto_path /tcl/lib/iwidgets4.0.2 in the script file. But it is giving the error as "can't find package Itcl 3.2" and so on. Can anyone guide me how to wrap all the scripts to EXE which are using Iwidgets packages also? Thanks, Muthu Muthu wrote: > Dear All, > > I am writing Tcl/TK based GUI aplication and I am using packages like > Iwidgets 4.0.2 in the scripts. When I am wrapping these scripts to Exe > using Freewrap application, it is giving error. > > After refering some of the documents I have included > lappend auto_path /tcl/lib/iwidgets4.0.2 in the script file. But it is > giving the error as "can't find package Itcl 3.2" and so on. > > Can anyone guide me how to wrap all the scripts to EXE which are using > Iwidgets packages also? > Go to http://sourceforge.net/project/showfiles.php?group_id=15218 and download the file ITCLsampleApp.zip for an example of how to do this. Also make sure you read the information on referring to wrapped files found at http://freewrap.sourceforge.net/freewrap_filenames.html Dear Dennis LaBelle, Thanks for the Info. I will refer it and will try that way. Thanks. Muthu Dennis LaBelle <labelled@nycap.r...

Redirection of TCL/Tk script errors?
Hi guys. I'm using ActiveTCL 8.4.x. Is there any way to redirect general script error output to a particular Proc rather than the default error widgets? If the worst happens, I'd rather users saw a simple tk_messageBox stating something simple and clear like "Application error" rather than fragments of TCL source code that might scare them. Synic wrote: > I'm using ActiveTCL 8.4.x. Is there any way to redirect general script error > output to a particular Proc rather than the default error widgets? Of course, see manpage about [bgerror]. kind regards -- Matthias Kraft Software AG, Germany (They that can give up essential liberty to obtain a little temporary) (safety deserve neither liberty nor safety. -- Benjamin Franklin) Matthias Kraft <Matthias.Kraft@nospam.softwareag.com> wrote: > Synic wrote: >> I'm using ActiveTCL 8.4.x. Is there any way to redirect general script error >> output to a particular Proc rather than the default error widgets? > > Of course, see manpage about [bgerror]. Thanks Matthias. That does exactly what I was after :-). ...

ANNOUNCE: ADB and ADBSQL pure-tcl database engine for Tcl/Tk
Dear All, I'm happy to announce today the first release of adb/adbsql. ADB together with the MySQL database connectivity module adbsql are a Tcl/Tk package useful for Tcl/Tk programmers that want to store their data in a database-kind of way with tables and fields. Two (optional) features of ADB that may make it worthwhile for you: * Writing the database as XML output and later of course the ability to read it. * Connecting directly to a MySQL database. The fun part of ADB is that you can either use it as a full pure tcl library, or you can use these advanced features that require additional packages. Both modules are released under open source LGPL or BSD licenses (your pick) More information: http://wiki.tcl.tk/6319 - Tcl/Tk wiki page on ADB http://sourceforge.net/projects/adbsql/ - Sourceforge page (including download area) http://adbsql.sourceforge.net/adb.html - Manual page of ADB http://adbsql.sourceforge.net/adbsql.html - Manual page of ADBSQL Kind regards, Roalt Aalmoes ...

Why can execution results in tcl shell differ than if using tcl script??
Hi, I have been posting a thread here: http://groups.google.com/group/comp.lang.tcl/browse_thread/thread/983d7ef3e4b1ab54# I have another question that might be related to it, I'm doing set of tcl commands (involving external shell commands execution) one time in tcl shell, and the other from a tcl script.. Although both command sequences are the same, I get quite different results!!! Why did this happens?? Thanks, Ahmad Ahmad wrote: > Hi, > > I have been posting a thread here: > http://groups.google.com/group/comp.lang.tcl/browse_thread/thread/983d7ef3e4b1ab54# > > I have another question that might be related to it, I'm doing set of > tcl commands (involving external shell commands execution) one time in > tcl shell, and the other from a tcl script.. > > Although both command sequences are the same, I get quite different > results!!! Why did this happens?? > > Thanks, > Ahmad The interactive Tcl shell has access to external functionality that a running script doesn't. That's done to make the interactive environment easier to work with. What, specifically, is the command sequence you're issuing in both cases? Jeff Hi Jeff, Thank you for your reply. I've a tcl script that finally creates a certain script, that is when I run from shell using "calibredrv -gui <certainRunScript>" from command line it do exactly what I expect. I have tried two scenarios of trials, and only one of...

TCL C API: receiving command from a script or from tcl command line ?
Hello, TCL allows to run commands from commandl line or from within a script file thanks to the command "source filename". I used TCL C API to embed my own commands. My question is : from my own commands, how can I know whether it was called from the script or directly from the shell ? Thanks, Fabrice Hi Fabrice, "fabrice" writes: > I used TCL C API to embed my own commands. My question is : from my > own commands, how can I know whether it was called from the script > or directly from the shell ? You can look at the variable tcl_interactive to distinguish the two modes. Note: It usually seems not a good idea to change the behaviour of your functions between use in a program (production mode) and interactive use (usually for experimentation and debugging). It's confusing for the users and it may make it difficult or impossible to reproduce some kinds of problems interactively. If you want to add more debug output in interactive mode, you can always add additional commands and flags for that purpose. benny fabrice wrote: > Hello, > > TCL allows to run commands from commandl line or from within a script > file thanks to the command "source filename". > > I used TCL C API to embed my own commands. My question is : from my own > commands, how can I know whether it was called from the script or > directly from the shell ? You could look at how the 'tcl_interactive' variable is set up and u...

Web resources about - Tcl/Tk without script - comp.lang.tcl

Jamiat conference: Ghulam Azad draws parallel between RSS, Islamic State; Sangh protests
Minutes later, Nandkumar repeated the statement before journalists in Nagaur, where the Akhil Bharatiya Pratinidhi Sabha, the Sangh’s highest ...

Billie Lourd Will Return With A Larger Role In ‘Star Wars Episode 8’
Billie Lourd was on the red carpet for Fox’s Scream Queens at Paleyfest on Saturday night. We’ll have a full story on Scream Queens later but ...

Go board game champion Lee Sedol finally beats Google’s AI
SEOUL (by Se Young Lee, Reuters) – South Korean Lee Sedol won his first match against a computer program developed by a Google subsidiary on ...

Doctor urged psychiatric hospital for Germanwings pilot before crash
Reuters Doctor urged psychiatric hospital for Germanwings pilot before crash Reuters PARIS A doctor consulted by the German pilot who crashed ...

Divers Pull Body of 2nd Tugboat Crew Member From Hudson River; 3rd Man in Tugboat Crash Still Missing ...
Divers pull body of 2nd tugboat crew member from Hudson River; 3rd man in tugboat crash still missing

Watch: ‘Alice Through the Looking Glass’ TV Spot Questions Daylight Saving Time
Was an extra hour stolen this morning? That’s what the new TV spot for Disney’s “Alice Through the Looking Glass” asks after Sunday’s Daylight ...

Kanye West says Justin Bieber hit was his "favorite song of 2015"
Kanye West — beloved by teen girls, teen boys, and multimillionaire hip-hop moguls. West has been relatively silent on Twitter for, say, the ...

Officials say unrest at prison in Alabama leaves 2 hurt
Inmates set a fire, seized control of a dormitory and stabbed two corrections officials during a violent uprising at a prison in southern Alabama, ...

Gunmen open fire at Ivory Coast resort town
Assailants opened fire on beachgoers Sunday in Grand-Bassam, a historic resort town near the capital, sending tourists fleeing through hotels. ...

Dominant Bowe wins again at speedskating World Cup finals
HEERENVEEN, Netherlands (AP) — Brittany Bowe won her fourth race of the speedskating World Cup finals on Sunday, taking the 1,000 meters to underscore ...

Resources last updated: 3/13/2016 7:11:53 PM