Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to have a form with 4 colums

Status
Not open for further replies.

amb1s1

Technical User
Nov 21, 2005
8
0
0
US
I'm creating a script to be able to configure 4 cisco routers at the time. I have not yet got into the on the script, but I couldn't find anywhere how to stack up couple of columns one beside the other one. I'm really knew in programming, so my script is probably a mess, but thats the only way to get better playing around. Also, I have to have this string $1$oe7A$/L7LibyrCTkR1Q on the script fot the router config, but how to make TCL/TK thing that it is not a variable. I try this {$1$oe7A$/L7LibyrCTkR1Q}, but it doesn't work. Thanks the following is the script that I'm working on.

Code:
#This function will be executed when the button is pushed
proc push_button {} {
	global age
	set  c1 [.host get]
	set  c2 [.loop5 get]
	set  c3 [.tun0 get]
	set  c4 [.g0/0desc get]
	set  c5 [.g0/0addr get]
	set  c6 [.g0/1Addr get]
	set  c7 [.s0des get]
	set  c8 [.s0/035 get]
	set  c9 [.dhcpex get]
	set  c10 [.dhcpnet get]
	set  c11 [.dhcpdro get]
	set  c12 [.pipg get]
	set  c13 [.sitenet get]
	set  c14 [.snmplocat get]
	
	.txt insert end "$c1 $c2 $c3 $c4 $c5 $c6  $c7 $c8 $c9 $c10 $c11 $c12 $c13 $c14 "
}

#Global Variables
set age 10

#GUI building
frame .frm -relief groove
label .lab -text "Router 1"
label .lab1 -text "Enter Hostname:"
entry .host
label .lab2 -text "Enter Loopback5:"
entry .loop5
label .lab3 -text "Enter Tunnel0:"
entry .tun0
label .lab4 -text "Enter G0/0 Description:"
entry .g0/0desc
label .lab5 -text "Enter G0/0 Address:"
entry .g0/0addr
label .lab6 -text "Enter G0/1 Address:"
entry .g0/1Addr
label .lab7 -text "Enter S0/0/0 Description:"
entry .s0des
label .lab8 -text "Enter S0/0/0.35 Address:"
entry .s0/035
label .lab9 -text "Enter DHCP Exclude-Address:"
entry .dhcpex
label .lab10 -text "Enter DHCP Pool Network:"
entry .dhcpnet
label .lab11 -text "Enter DHCP Default Route:"
entry .dhcpdro
label .lab12 -text "Enter PIP Provider Gateway:"
entry .pipg
label .lab13 -text "Enter Store  Network 10.si.te.0:"
entry .sitenet
label .lab14 -text "Enter snmp-server location:"
entry .snmplocat
button .but -text "Push Me" -command "push_button"
#Text Area
frame .textarea
text .txt -yscrollcommand ".srl_y set" -xscrollcommand ".srl_x set" \
	-width 200 -height 200
scrollbar .srl_y -command ".txt yview" -orient v
scrollbar .srl_x -command ".txt xview" -orient  h

#Geometry Management
pack .lab -in .frm 
pack .lab1 -in .frm 
pack .host -in .frm 
pack .lab2 -in .frm 
pack .loop5 -in .frm 
pack .lab3 -in .frm 
pack .tun0 -in .frm 
pack .lab4 -in .frm 
pack .g0/0desc -in .frm 
pack .lab5 -in .frm 
pack .g0/0addr -in .frm 
pack .lab6 -in .frm 
pack .g0/1Addr -in .frm 
pack .lab7 -in .frm 
pack .s0des -in .frm
pack .lab8 -in .frm
pack .s0/035 -in .frm
pack .lab9 -in .frm
pack .dhcpex -in .frm
pack .lab10 -in .frm
pack .dhcpnet -in .frm
pack .lab11 -in .frm
pack .dhcpdro -in .frm
pack .lab12 -in .frm
pack .pipg -in .frm
pack .lab13 -in .frm
pack .sitenet -in .frm
pack .lab14 -in .frm
pack .snmplocat -in .frm
pack .frm
pack .but
grid .txt   -in .textarea -row 1 -column 1
grid .srl_y -in .textarea -row 1 -column 2 -sticky ns
grid .srl_x -in .textarea -row 2 -column 1 -sticky ew
pack .textarea
 
First, take a look at the Tktable module.

As for your second question, consider:
Code:
e:\>tclsh
% set str1 $1$oe7A$/L7LibyrCTkR1Q
can't read "1": no such variable
% set str1 \$1\$oe7A\$/L7LibyrCTkR1Q
$1$oe7A$/L7LibyrCTkR1Q
%

_________________
Bob Rashkin
 
Another possibility to consider is widget 'panedwindow' or using the 'grid' window manager
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top