Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Opening a TCL program from within another TCL program in ANSYS Tcl-Tk
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  1 message - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Jose  
View profile  
 More options Apr 25 2012, 2:38 pm
Newsgroups: comp.lang.tcl
From: Jose <joseamirandave...@gmail.com>
Date: Wed, 25 Apr 2012 11:38:03 -0700 (PDT)
Local: Wed, Apr 25 2012 2:38 pm
Subject: 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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »