[GiDlist] combobox in tcl-file

Moderator: GiD Team

Post Reply
Andreas Friedberg

[GiDlist] combobox in tcl-file

Post by Andreas Friedberg »

hi everybody,

I've created a tcl-file for a problemtype that allows me to generate geometric entities from a window called "Geometry" with the procedure "Geometry". I need to create a sort of combobox widget inside this window with three standard values between which the user has to choose. I tried to do that with the listbox widget as described in the standard tcl-documentation, but I couldn't manage to assign the currently selected value of the listbox to a global variable so as to use this information later on in the procedure "Draw". So I had to create three checkbuttons that can be turned on and off, but this solution is not satisfying, because I don't know how to deselect the other two buttons when one of the checkbuttons is selected.
This is how looks my tcl-file now:

...
proc Geometrie {} {

global GeometriePriv

set w .gid.geometrie

InitWindow $w "Geometrie" GeometryWindow

frame $w.title
label $w.title.belastungsArt -text " Belastungsart "

frame $w.check
label $w.check.sLt -text " schlaffe Last "
checkbutton $w.check.sLcb -variable GeometriePriv(sL)
label $w.check.sPt -text " starre Plate "
checkbutton $w.check.sPcb -variable GeometriePriv(sP)
label $w.check.ePt -text " elastische Platte "
checkbutton $w.check.ePcb -variable GeometriePriv(eP)


if { $GeometriePriv(sL) } { $w.check.sPcb deselect
$w.check.ePcb deselect }

if { $GeometriePriv(sP) } { $w.check.sLcb deselect
$w.check.ePcb deselect }

if { $GeometriePriv(eP) } { $w.check.sLcb deselect
$w.check.sPcb deselect }
...

These last if-commands do not work instantly. In fact, what I need is a combobox like the ones implemented in the configuration files with the command:

QUESTION: Belastung#CB#(one,two,three)
VALUE: one

Then I need to store the currently selected value in a variable so I can use it in another procedure.

Can anybody help?

thanks, Andreas




Andreas
--
http://www.berlin.de - meine stadt im netz.
***********************************************************************
Nur 1 x Anmelden für 600 Warenproben und Gutscheine wie z.B. edle Shampoos, Zigarretten, CD´s, Süßigkeiten, Parfüms, Tiernahrung und vieles vieles mehr Jetzt unverbindlich informieren: http://www.probenwelt.de/partner/?id=33
***********************************************************************
Enrique Escolano

[GiDlist] combobox in tcl-file

Post by Enrique Escolano »

You can use a combobox Bwidget (the Bwitgets code is included by default to be used from GiD)
with -textvariable linked to your global variable, for example:

proc Geometrie {} {
global GeometriePriv
set w .gid.geometrie
InitWindow $w "Geometrie" GeometryWindow

set GeometriePriv(Belastungsart) "three"
frame $w.title
label $w.title.lb -text "Belastungsart"
combobox $w.title.combo -editable 0 -textvariable GeometriePriv(Belastungsart)
$w.title.combo add "one"
$w.title.combo add "two"
$w.title.combo add "three"

button $w.title.but -text "See Value" -command SeeValue
grid $w.title.lb $w.title.combo
grid $w.title.but
grid $w.title
}

proc SeeValue {} {
global GeometriePriv
WarnWin $GeometriePriv(Belastungsart)
}

It is also possible, to separate the showed text from the variable value
(of interest for example in multilingual translations), using -command
to update the variable value from the combobox and with a variable value
trace to update the combobox text

Regards
Enrique Escolano

----- Original Message -----
From: "Andreas Friedberg" friedberg.andreas at berlin.de
To: gidlist at gatxan.cimne.upc.es
Sent: Tuesday, January 07, 2003 1:50 PM
Subject: [GiDlist] combobox in tcl-file


hi everybody,

I've created a tcl-file for a problemtype that allows me to generate geometric entities from a window called "Geometry" with the procedure "Geometry". I need to create a sort of combobox widget inside this window with three standard values between which the user has to choose. I tried to do that with the listbox widget as described in the standard tcl-documentation, but I couldn't manage to assign the currently selected value of the listbox to a global variable so as to use this information later on in the procedure "Draw". So I had to create three checkbuttons that can be turned on and off, but this solution is not satisfying, because I don't know how to deselect the other two buttons when one of the checkbuttons is selected.
This is how looks my tcl-file now:

...
proc Geometrie {} {

global GeometriePriv

set w .gid.geometrie

InitWindow $w "Geometrie" GeometryWindow

frame $w.title
label $w.title.belastungsArt -text " Belastungsart "

frame $w.check
label $w.check.sLt -text " schlaffe Last "
checkbutton $w.check.sLcb -variable GeometriePriv(sL)
label $w.check.sPt -text " starre Plate "
checkbutton $w.check.sPcb -variable GeometriePriv(sP)
label $w.check.ePt -text " elastische Platte "
checkbutton $w.check.ePcb -variable GeometriePriv(eP)


if { $GeometriePriv(sL) } { $w.check.sPcb deselect
$w.check.ePcb deselect }

if { $GeometriePriv(sP) } { $w.check.sLcb deselect
$w.check.ePcb deselect }

if { $GeometriePriv(eP) } { $w.check.sLcb deselect
$w.check.sPcb deselect }
...

These last if-commands do not work instantly. In fact, what I need is a combobox like the ones implemented in the configuration files with the command:

QUESTION: Belastung#CB#(one,two,three)
VALUE: one

Then I need to store the currently selected value in a variable so I can use it in another procedure.

Can anybody help?

thanks, Andreas




Andreas
--
http://www.berlin.de - meine stadt im netz.
***********************************************************************
Nur 1 x Anmelden für 600 Warenproben und Gutscheine wie z.B. edle Shampoos, Zigarretten, CD´s, Süßigkeiten, Parfüms, Tiernahrung und vieles vieles mehr Jetzt unverbindlich informieren: http://www.probenwelt.de/partner/?id=33
***********************************************************************

_______________________________________________
GiDlist mailing list
GiDlist at gid.cimne.upc.es
http://gid.cimne.upc.es/mailman/listinfo/gidlist

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listas.cimne.upc.edu/pipermail/gidlist/attachments/20030108/0483a3d0/attachment.htm
Enrique Escolano

[GiDlist] combobox in tcl-file

Post by Enrique Escolano »

Sorry,a small bug, in the previous example, the combo widget works ok in GiD, but is not a BWidget (the BWidget does not have the "add" method).

To use the bwidget, instead
combobox $w.title.combo -editable 0 -textvariable GeometriePriv(Belastungsart)
$w.title.combo add "one"
$w.title.combo add "two"
$w.title.combo add "three"
use:
ComboBox $w.title.combo -editable 0 -textvariable GeometriePriv(Belastungsart) -values {"one" "two" "three"}

Note the upper letters of the "ComboBox" Bwidget command and the -values parameter

Enrique Escolano

----- Original Message -----
From: Enrique Escolano
To: gidlist at gatxan.cimne.upc.es
Sent: Wednesday, January 08, 2003 12:13 PM
Subject: Re: [GiDlist] combobox in tcl-file


You can use a combobox Bwidget (the Bwitgets code is included by default to be used from GiD)
with -textvariable linked to your global variable, for example:

proc Geometrie {} {
global GeometriePriv
set w .gid.geometrie
InitWindow $w "Geometrie" GeometryWindow

set GeometriePriv(Belastungsart) "three"
frame $w.title
label $w.title.lb -text "Belastungsart"
combobox $w.title.combo -editable 0 -textvariable GeometriePriv(Belastungsart)
$w.title.combo add "one"
$w.title.combo add "two"
$w.title.combo add "three"

button $w.title.but -text "See Value" -command SeeValue
grid $w.title.lb $w.title.combo
grid $w.title.but
grid $w.title
}

proc SeeValue {} {
global GeometriePriv
WarnWin $GeometriePriv(Belastungsart)
}

It is also possible, to separate the showed text from the variable value
(of interest for example in multilingual translations), using -command
to update the variable value from the combobox and with a variable value
trace to update the combobox text

Regards
Enrique Escolano

----- Original Message -----
From: "Andreas Friedberg" friedberg.andreas at berlin.de
To: gidlist at gatxan.cimne.upc.es
Sent: Tuesday, January 07, 2003 1:50 PM
Subject: [GiDlist] combobox in tcl-file


hi everybody,

I've created a tcl-file for a problemtype that allows me to generate geometric entities from a window called "Geometry" with the procedure "Geometry". I need to create a sort of combobox widget inside this window with three standard values between which the user has to choose. I tried to do that with the listbox widget as described in the standard tcl-documentation, but I couldn't manage to assign the currently selected value of the listbox to a global variable so as to use this information later on in the procedure "Draw". So I had to create three checkbuttons that can be turned on and off, but this solution is not satisfying, because I don't know how to deselect the other two buttons when one of the checkbuttons is selected.
This is how looks my tcl-file now:

...
proc Geometrie {} {

global GeometriePriv

set w .gid.geometrie

InitWindow $w "Geometrie" GeometryWindow

frame $w.title
label $w.title.belastungsArt -text " Belastungsart "

frame $w.check
label $w.check.sLt -text " schlaffe Last "
checkbutton $w.check.sLcb -variable GeometriePriv(sL)
label $w.check.sPt -text " starre Plate "
checkbutton $w.check.sPcb -variable GeometriePriv(sP)
label $w.check.ePt -text " elastische Platte "
checkbutton $w.check.ePcb -variable GeometriePriv(eP)


if { $GeometriePriv(sL) } { $w.check.sPcb deselect
$w.check.ePcb deselect }

if { $GeometriePriv(sP) } { $w.check.sLcb deselect
$w.check.ePcb deselect }

if { $GeometriePriv(eP) } { $w.check.sLcb deselect
$w.check.sPcb deselect }
...

These last if-commands do not work instantly. In fact, what I need is a combobox like the ones implemented in the configuration files with the command:

QUESTION: Belastung#CB#(one,two,three)
VALUE: one

Then I need to store the currently selected value in a variable so I can use it in another procedure.

Can anybody help?

thanks, Andreas




Andreas
--
http://www.berlin.de - meine stadt im netz.
***********************************************************************
Nur 1 x Anmelden für 600 Warenproben und Gutscheine wie z.B. edle Shampoos, Zigarretten, CD´s, Süßigkeiten, Parfüms, Tiernahrung und vieles vieles mehr Jetzt unverbindlich informieren: http://www.probenwelt.de/partner/?id=33
***********************************************************************

_______________________________________________
GiDlist mailing list
GiDlist at gid.cimne.upc.es
http://gid.cimne.upc.es/mailman/listinfo/gidlist

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listas.cimne.upc.edu/pipermail/gidlist/attachments/20030108/e0ba55b8/attachment.htm
VSayako Willy

[GiDlist] How to create a Table in tcl?

Post by VSayako Willy »

Hi GiD Team

How can we create a Table (somehow like Table in
word or excel) with the tcl/Tk? any one has some
ideas? Please advice.

Warm Regards



__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
Enrique Escolano

[GiDlist] How to create a Table in tcl?

Post by Enrique Escolano »

See the Tktable widget from:

http://tktable.sourceforge.net/

Enrique Escolano

----- Original Message -----
From: "VSayako Willy" vilaysako at yahoo.com
To: gidlist at gatxan.cimne.upc.es
Sent: Thursday, January 09, 2003 8:56 AM
Subject: [GiDlist] How to create a Table in tcl?



Hi GiD Team

How can we create a Table (somehow like Table in
word or excel) with the tcl/Tk? any one has some
ideas? Please advice.

Warm Regards



__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
_______________________________________________
GiDlist mailing list
GiDlist at gid.cimne.upc.es
http://gid.cimne.upc.es/mailman/listinfo/gidlist

Pablo Perez del Castillo

[GiDlist] sharp angle in Tdyn3d

Post by Pablo Perez del Castillo »

Hello;
In Ransol demo, i am trying to modelate a wing with diferent section
along the span, so the sharp angle is changing along the span, Tdyn3d
has option about sharp angle to correct velocities in the trailing edge,
is it necesary to mark?, it is necesary what angle i must to entry,??
Advanced thanks
Pablo
Enrique Escolano

[GiDlist] sharp angle in Tdyn3d

Post by Enrique Escolano »

Sharp_Angle should be slightly greater than the maximum angle of the
wing. This will apply the correct condition for the whole wing.

Regards
----- Original Message -----
From: "Pablo Perez del Castillo" pablopdc at terra.es
To: gidlist at gatxan.cimne.upc.es
Sent: Friday, January 10, 2003 6:18 PM
Subject: [GiDlist] sharp angle in Tdyn3d


Hello;
In Ransol demo, i am trying to modelate a wing with diferent section
along the span, so the sharp angle is changing along the span, Tdyn3d
has option about sharp angle to correct velocities in the trailing edge,
is it necesary to mark?, it is necesary what angle i must to entry,??
Advanced thanks
Pablo

_______________________________________________
GiDlist mailing list
GiDlist at gid.cimne.upc.es
http://gid.cimne.upc.es/mailman/listinfo/gidlist

Pablo Perez del Castillo

[GiDlist] sharp angle in Tdyn3d

Post by Pablo Perez del Castillo »

Hello again;
I try with and without Sharp_Angle the same wing, and it gets lift and drag
bigger than without S_A, so can you explain me how works this option inside
the solver, or what is the physical sense of this option? (it force the
trailing edge to kutta condition??)
A lot of thanks
Pablo

Enrique Escolano escribió:

Sharp_Angle should be slightly greater than the maximum angle of the
wing. This will apply the correct condition for the whole wing.

Regards
----- Original Message -----
From: "Pablo Perez del Castillo" pablopdc at terra.es
To: gidlist at gatxan.cimne.upc.es
Sent: Friday, January 10, 2003 6:18 PM
Subject: [GiDlist] sharp angle in Tdyn3d

Hello;
In Ransol demo, i am trying to modelate a wing with diferent section
along the span, so the sharp angle is changing along the span, Tdyn3d
has option about sharp angle to correct velocities in the trailing edge,
is it necesary to mark?, it is necesary what angle i must to entry,??
Advanced thanks
Pablo

_______________________________________________
GiDlist mailing list
GiDlist at gid.cimne.upc.es
http://gid.cimne.upc.es/mailman/listinfo/gidlist


_______________________________________________
GiDlist mailing list
GiDlist at gid.cimne.upc.es
http://gid.cimne.upc.es/mailman/listinfo/gidlist
Enrique Escolano

[GiDlist] sharp angle in Tdyn3d

Post by Enrique Escolano »

Sorry, I' unknown this concepts about the problem type Tdyn. I' only known
about GiD.
Try to send your Tdyn CFD questions to info at compassis.com

Enrique

----- Original Message -----
From: "Pablo Perez del Castillo" pablopdc at terra.es
To: gidlist at gatxan.cimne.upc.es
Sent: Saturday, January 11, 2003 1:38 AM
Subject: Re: [GiDlist] sharp angle in Tdyn3d


Hello again;
I try with and without Sharp_Angle the same wing, and it gets lift and
drag
bigger than without S_A, so can you explain me how works this option
inside
the solver, or what is the physical sense of this option? (it force the
trailing edge to kutta condition??)
A lot of thanks
Pablo

Enrique Escolano escribió:

Sharp_Angle should be slightly greater than the maximum angle of the
wing. This will apply the correct condition for the whole wing.

Regards
----- Original Message -----
From: "Pablo Perez del Castillo" pablopdc at terra.es
To: gidlist at gatxan.cimne.upc.es
Sent: Friday, January 10, 2003 6:18 PM
Subject: [GiDlist] sharp angle in Tdyn3d

Hello;
In Ransol demo, i am trying to modelate a wing with diferent section
along the span, so the sharp angle is changing along the span, Tdyn3d
has option about sharp angle to correct velocities in the trailing
edge,
is it necesary to mark?, it is necesary what angle i must to entry,??
Advanced thanks
Pablo

_______________________________________________
GiDlist mailing list
GiDlist at gid.cimne.upc.es
http://gid.cimne.upc.es/mailman/listinfo/gidlist


_______________________________________________
GiDlist mailing list
GiDlist at gid.cimne.upc.es
http://gid.cimne.upc.es/mailman/listinfo/gidlist

_______________________________________________
GiDlist mailing list
GiDlist at gid.cimne.upc.es
http://gid.cimne.upc.es/mailman/listinfo/gidlist

Post Reply