f



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 O:/mad_projects_2/ANSYS/Macros/
PowerAnnotation.tcl'
	}
}

namespace eval MADTools {
	proc BuildGui {} {
		destroy .dlgMADTools
set parent [toplevel .dlgMADTools -class Ansys]
		#Sets its title
		wm title $parent "MAD TCL-TK Tools     by Jose Miranda"
		image create photo .dlgMADTools.ibr_Campbell_Image -format GIF -file
"O:/mad_projects_2/ANSYS/Macros/Images_for_TCL_TK/default.gif"
		button .dlgMADTools.ibrCampbell_Button -
image .dlgMADTools.ibr_Campbell_Image -text "IBR Campbell Analysis
Submitter" -compound top -command "Tools::IBRCambpell" -background
$bgColor
grid .dlgMADTools.ibrCampbell_Button -in .dlgMADTools.midFrame -row 2 -
column 1 -columnspan 1 -sticky ew

#Disable window resizing
		wm resizable .dlgMADTools 0 0
}

BuildGui
}


###########################
#Second Tcl file (Excerpt of IBR_CAS.tcl):
###########################

namespace eval CAS {
	proc proc1 {} {
		...
		...
	}
	proc proc2 {} {
		...
		...
	}

	destroy .dlgCAS

	set parent [toplevel .dlgCAS -class Ansys]
	#Sets its title
	wm title $parent "IBR Campbell Analysis Submitter v1.0      By Carlos
Fernandez (IAS)"

	button .dlgCAS.browse3DDatabase_Button -text "Browse" -command
"CAS::BrowseDB 3DDatabase"  -background $bgColor

	grid .dlgCAS.browse3DDatabase_Button -in .dlgCAS.topFrame -row 3 -
column 3 -columnspan 1
}
0
4/25/2012 6:38:03 PM
comp.lang.tcl 23429 articles. 2 followers. Post Follow

0 Replies
2473 Views

Similar Articles

[PageSpeed] 43

Reply:

Similar Artilces:

l'C program executing from a tcl script with pipe opened using open command in Tcl
Hi all, I wanted to communicate with a C program from a Tcl script.. The test code i have written is below Both the 'C' program and Tcl script are located in the same directory. The 'C' program is below. I have named it CTCL.C #include<stdio.h> #include<string.h> int main() { int i; char c[30]; printf("Reading..."); scanf("%s",c); printf("String read is :%s\n",c); fflush(stdout); return 0; } I have compiled the program with the command cc CTCL.C -o ctcl So the executable was generated with the name 'ctcl' The Tcl script...

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...

YouTube Playlist: Tcl/Tk Object Oriented Programming Using Itcl (incr Tcl) Lessons
Hi. Like I promised you hours ago.. The playlist in English : https://www.youtube.com/playlist?list=PLsAEIIjTPIo_1qeuc-rYwk0nxWAM38Dl_ The same playlist in Arabic : https://www.youtube.com/playlist?list=PLsAEIIjTPIo_91kA-iUz_5XGNmHzivHBG Enjoy! On Saturday, January 17, 2015 at 4:04:21 PM UTC+2, Rani Ahmad wrote: > Hi. > > Like I promised you hours ago.. > > The playlist in English : > > https://www.youtube.com/playlist?list=PLsAEIIjTPIo_1qeuc-rYwk0nxWAM38Dl_ > > The same playlist in Arabic : > > https://www.youtube.com/playli...

[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...

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-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 ...

tcl hangs on exit for multiple open calls from within same tcl script
Hi, I am looking to run a couple of processes in parallel. But a strange hang = occurs randomly. I am invoking two tcl commands using open in parallel. Now= after a while one of the process would just hang indefinitely which I am n= ot able to understand why. The issue is easily reproducible on win 2008 ser= ver and other multi core machines. Am I doing something wrongly? What is th= e best way to do this? To reproduce, you just have to create the files and run loop.bat. You shoul= d see the hang within 15-20 minutes. Following are the files I am using=20 ******** loop.bat ****** @echo off :loop tclsh 1.tcl goto loop ***************** Contents of file 1.tcl ***************** #!/bin/sh #DO NOT CHANGE THOSE 3 FIRST LINES \ exec tclsh $0 "$@" set status [catch { exec tclsh 2.tcl } outcmd] puts $outcmd exit 0 ******* Contents of file 2.tcl ***** #!/bin/sh #DO NOT CHANGE THOSE 3 FIRST LINES \ exec tclsh $0 "$@" set cmd1 "tclsh 6.tcl &" set cmd2 "tclsh 5.tcl &" set out1 "" set out2 "" proc isProcessDone { channel logText } { gets $channel currentline while {[eof $channel] =3D=3D 0} { set logText "$logText\n $currentline" gets $channel currentline } return $logText } puts "hi" set imChannel1 [open "| $cmd1"] puts "hi1 $imChannel1" set imChannel2 [open "| $cmd2"] puts...

Registration Open for 19th Annual Tcl/Tk Conference (Tcl'2012)
19th Annual Tcl/Tk Conference (Tcl'2012) http://www.tcl.tk/community/tcl2012/ November 12 - 16, 2012 Sessions: National Museum of Health and Medicine Chicago 175 W. Washington Chicago, IL 60602 Rooms: Holiday Inn Chicago Mart Plaza 350 West Mart Center Drive Chicago, Illinois, USA Map/Transport: https://maps.google.com/maps/ms?msid=204739899073144451536.0004c144222a9036c99f6&msa=0&ll=41.885266,-87.633734&spn=0.008443,0.018818 http://wiki.tcl.tk/28843#pagetoca7e55932 I am pleased to announce that registration for the Conference is now open at http://www.tcl.tk/community/tcl2012/reg.html To book a room at the conference hotel at reduced rates please follow the instructions on that page. Note that the offer of reduced rates expires on October 20. Book early. Our schedule can be found at http://www.tcl.tk/community/tcl2012/schedule.html Conference Committee Clif Flynt Noumena Corp General Chair, Website Admin Andreas Kupries ActiveState Software Inc. Program Chair Cyndy Lilagan Nat. Museum of Health & Medicine, Chicago Site/Facilities Chair Arjen Markus Deltares Brian Griffin Mentor Graphics Donal Fellows University of Manchester Gerald Lester KnG Consulting, LLC Jeffrey Hobbs ActiveState Software Inc. Kevin Kenny GE Global Research Center Larry Virden Mike Doyle ...

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...

Sourcing a TCL file from within a tcl file
I am a newbie which I am sure I don't need to state :) I am trying to create a variable with a TCL file that will source another tcl file when I type the variable name something like this if I enter A through my keyboard then source a.tcl Can someone show me how to do this thanks guy On Dec 10, 1:15=A0pm, guy <gcoletta2...@gmail.com> wrote: > I am a newbie which I am sure I don't need to state :) > > I am trying to create a variable with a TCL file that will source > another tcl file when I type the variable name > > something like this > > if I e...

tcl-snmptools: SNMP v1/v2/v3 operations for Tcl. (Tcl package)
This is an announcement for a relatively new Tcl project: tcl-snmptools Tcl-snmptools is a Tcl interface to the Net-SNMP library which provides operations for the management of remote SNMP agents. It supports all the standard SNMP v1/v2/v3 operations: connect, close, get, set, getnext, walk, bulkget, bulkwalk, trap, translate and others. It is currently in a functional state, but more work and testing needs to be done. Home page: http://sourceforge.net/projects/tcl-snmptols/ Man page: http://tcl-snmptols.sourceforge.net/ Author: Alexandros Stergiakis alsterg ...

tcl application with tcl application
Here is another question, I have one tcl-based application A, my co- worker has a tcl-based application B. Now I want to integrate my application A into the application B. After integration, I want to be able to run A's tcl command in B. Assume I can only change A's code, is there any way to do this? On 17 Dez., 07:03, teacupfull business <teacupfull.busin...@gmail.com> wrote: > Here is another question, I have one tcl-based application A, my co- > worker has a tcl-based application B. Now I want to integrate my > application A into the application B. >...

How to compile tcl or encrypt tcl
I use TclPro1.5 to compile my tcl script with tixwish in the Solaris before. But I cannot use the same method in Linux. Why? Is there any utility for me to compile or encrypt the code by using tixwish? The following is the simple code if I use the tixwish: #!/home/albertl/local/bin/tixwish puts "haha" And after using procomp by the TclPro1.5 Error in startup script: The TclPro ByteCode Loader is not available or does not support the correct version while executing "error "The TclPro ByteCode Loader is not available or does not support the correct version""...

How Tcl speaks for itself and how Tcl is not spoken for...
Hello It's Friday and... well... Two things about Tcl going through my mind this week, a nice anecdote and a eyebrow-rising thing on Wikipedia: Anecdote: Until three months ago I worked in a scientific institue where I wrote much software in Tcl, especially a big Build and Report System, some tools for automatic checking of coding style and other things. Tcl had a bad reputation there (not because of me... they dropped Tcl before I started there in favour of Joy, then JavaScript and now Python) and besides me, there was only one co-worker who appearantly writes some small Tcl-Scripts to...

best reference for Tcl Programming | http://freepdf-ebook.blogspot.com/2007/12/tcl-scripting-language.html
download now http://freepdf-ebook.blogspot.com/2007/12/tcl-scripting-language.html On 11 dec, 23:27, Tony Andreas <xtw...@gmail.com> wrote: > download nowhttp://freepdf-ebook.blogspot.com/2007/12/tcl-scripting-language.html I do not want to sound too critical or offend you in any way, but that page contains a few typos. You may want to correct these, as - at least to me, at first sight - it gives a bad impression about the quality of the work. Regards, Arjen On Dec 11, 5:27 pm, Tony Andreas <xtw...@gmail.com> wrote: > download nowhttp://freepdf-ebook.blogspot.com/2007/1...

Extending TCL in C with tcl.h - Disabliing [<tcl-cmd>] feature
Hi, TCL has a command execution syntax like this: [<tcl cmd>] Anything inside the 3rd bracket will be executed as a Tcl command by the Tcl interprater. Is there any way I can disable/delete this Tcl construct [ <tcl-cmd>]? In other words, my Tcl interprator should print "[32]" for tcl command puts "[32]" It should not try to treat [] as a special character. Is this any way possible while extending Tcl in C with tcl.h? Thank you, Arijit * arijit79@gmail.com | puts "[32]" | | It should not try to treat [] as a special character. Check out the TCL quoting rules. http://www.tcl.tk/man/tcl8.4/TclCmd/Tcl.htm http://www.tcl.tk/man/tcl8.4/TclCmd/Tcl.htm#M10 http://www.tcl.tk/man/tcl8.4/TclCmd/Tcl.htm#M15 Any of puts {[32]} puts "\[32\]" will do the trick. R' On May 8, 3:14 am, ariji...@gmail.com wrote: > Is there any way I can disable/delete this Tcl construct [ <tcl-cmd>]? By doing this, you would disable the primary functionality of Tcl. I'm certain you could go into the tcl source and stop it - but why not talk about what you are really trying to do. Perhaps someone can give you a better way of doing what you are wanting to do. ...

[ANN] Registration open && 2nd Call For Papers
Hello comp.lang.tcl, fyi ... 22nd Annual Tcl/Tk Conference (Tcl'2015) http://www.tcl.tk/community/tcl2015/ October 19 - 23, 2015 Comfort Suites Manassas 7350 Williamson Blvd, 20109 Manassas, Virginia, USA Important Dates: [[ Attention! Registration is open! Please have a look at http://www.tcl.tk/community/tcl2015/register.html ]] Abstracts and proposals due August 24, 2015 Notification to authors August 31, 2015 WIP and BOF reservations open July 27, 2015 Author materials due September 28, 2015 Tutorials Start October 19, 2015 Co...

TCL
Hello, i would like to build TCL/TK as a separate DLL-Library. Can anyone tell me how this can be done with VC 6.0? Best regards, Reinhold "Reinhold.kwauka" <bernd-reinhold.kwauka@t-online.de> wrote: >Hello, > >i would like to build TCL/TK as a separate DLL-Library. Can anyone tell me >how this can be done >with VC 6.0? > >Best regards, >Reinhold > 1) get the source from http://tcl.sourceforge.net/ 2) open a command prompt 3) cd to the win/ subdirectory 4) call vcvars32.bat located in ??\vc98\bin\ of vc6 for wherever you installed it. 5) type @ the prompt: nmake -f makefile.vc -- David Gravereaux <davygrvy@pobox.com> [species: human; planet: earth,milkyway(western spiral arm),alpha sector] Reinhold.kwauka wrote: > Hello, > > i would like to build TCL/TK as a separate DLL-Library. Can anyone tell me > how this can be done > with VC 6.0? > > Best regards, > Reinhold > > Its already done. Just download a binary release for windows and check \Program Files\Tcl\lib for the DLLs and static libraries. ...

Tcl
Hello, where can I see for tcl syntacs and how-to run a tcl test? Thank You Vittore ___________________________________ Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB http://mail.yahoo.it ---------------------------------------------------------------------------- Posted to the ptolemy-hackers mailing list. Please send administrative mail for this list to: ptolemy-hackers-request@ptolemy.eecs.berkeley.edu ...

Tcl
Hello all. I found on hobbes the afaik latest Tcl for Os/2 v8.35 Is there any newer port, cause i try to update the eggdrop and that says: Your Tcl version is much too old for Eggdrop to use. You should download and compile a more recent version. The most reliable current version is 8.5.X and can be downloaded from ftp://tcl.activestate.com/pub/tcl/tcl8_5/. -- With the best regards from the Netherlands, Tu, "Tellerbop" <Tellerbop@wint.nl>, hai scritto questo in data Wed, 14 Jan 2009 19:11:18 UTC: > Hello all. > > I found on hobbes the afaik latest Tcl for Os/2...

Tcl/Tk as subordinate program.
Tcl was designed as a glue program. With the addition of Tk it has also become a gui programming language. But the assumption is that Tcl is the program that starts other programs. I have a series of programs which need the graphical capabilities of TK not as part of a main program but as a callable subroutine. This is the principle behind Perl/Tk. I would like a similar interface but not using Perl but rather C as the interface to Tk. The books describe in detail how to call a C program from Tcl/Tk but not the reverse, calling a Tcl/Tk entity from another program. Has anyone done this kind o...

wrapper for Tcl/Tk programs
Hi, I am searching for a wrapper which makes applications distributable that I write. I have already tried prowrap and freewrap, but it seems that they do not work as I would expect. The main thing, that I want is that _all_ depended packages from the tcl lib directory (in my case that is C:/Tcl/lib) are included more or less automatically, so that there is no need to specify hundrets of extra arguments and write 1000 lines of extra code to hack the application until it works as a wrapped one. The latter is really painfull, especially if you want to wrap an application that you have not writt...

Connecting a C program with a tcl program with a socket
Dear readers, Several threads on this newsgroup mentioned communication between external programs and a tcl program, or controlling an external program with by a tcl program. In essence, the basic means to do this relatively gracefull is to open a socket (or pipe) connection between the two, and let them communicate over it using messages. Just for those who asked for it or with an interest, not in this case as well throughwrought result of many tests, but an example of how this principle can work in practice, at least it did for me, and did so long in the past, using no all to speci...

question about tcl/tk and c program
In my Tcl/Tk scripts, I want to program different branches according to the result of my C extension procedures. In the C procedure, we usually use such codes as follow: int CountStart(ClientData clientData, Tcl_Interp *interp,int argc, char *argv[]) { ............... ................ interp->result = "end vpstart."; //return TCL_OK; return TCL_ERROR; } In Tcl/Tk scripts, we can use "set ret [count_start $sym]" or "catch {count_start $sym} ret" to call the C procedure CountStart. The variable "ret" is assigned with the string which was saved...

Web resources about - Opening a TCL program from within another TCL program in ANSYS Tcl-Tk - comp.lang.tcl

Opening of the Liverpool and Manchester Railway - Wikipedia, the free encyclopedia
The opening of the Liverpool and Manchester Railway ( L&M ) took place on 15 September 1830. Work on the L&M began in the 1820s, to connect the ...

Facebook Weekly Highlights Brings You The NFL’s Opening Week, More U.S. Open Action
Facebook Weekly Highlights features photos posted to the social network by celebrities and athletes. This week’s edition featured the photo to ...

Gold Coast Titans grab NRL season opening win against Newcastle Knights
In just his second game, Ashley Taylor has outpointed NSW No.7 Trent Hodkinson to help steer Gold Coast Titans to a 30-12 NRL season-opening ...

NRL's biggest stars facing lengthy stints on the sidelines after injury-riddled opening round
Some of the game's biggest names in the NRL are facing extended periods on the sidelines after the opening round of the season. Michael Chammas ...

Gold Coast Titans grab NRL season opening win against Newcastle Knights
In just his second game, Ashley Taylor has outpointed NSW No.7 Trent Hodkinson to help steer Gold Coast Titans to a 30-12 NRL season-opening ...

NRL's biggest stars facing lengthy stints on the sidelines after injury-riddled opening round
Some of the game's biggest names in the NRL are facing extended periods on the sidelines after the opening round of the season. Michael Chammas ...

Two Inch Astronaut made a video for "Personal Life," opening the Hop Along / Speedy Ortiz tour
Two Inch Astronaut hearken back to '90s DC post-hardcore on their new J. Robbins-produced album. Check out the video for the title track, and ...

'Zootopia' has Disney's biggest box office opening ever for an animated movie
... weekend as it took the top spot at the box office with an estimated $73.7 million, according to pro.boxoffice.com . That's the biggest opening ...

Lupita Nyong’o in green lace Balmain at ‘Eclipsed’ opening night: lovely or doily?
... night. I’m sorry I didn’t get to these photos yesterday, but they came in later than I was expecting. Lupita attended the big Broadway opening ...

Gray gets 1st start, opening day nod; A's beat White Sox
GLENDALE, Ariz. (AP) — Sonny Gray pitched three innings in his first start of the spring and then was named Oakland's opening day starter after ...

Resources last updated: 3/13/2016 10:12:46 AM