Add multiple buttons in frame using TCL/TK.


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Add multiple buttons in frame using TCL/TK.
# 1  
Old 07-21-2010
Add multiple buttons in frame using TCL/TK.

Hi all,
I am trying to add multiple buttons in frame using TCL/TK.

If i am adding more buttons then they will not shown in the frame, as all are added in single line. I wanted to put them in the next line once it reaches to end of frame.

I wanted to put them like below:

-----------------------------
|
| B1 B2 B3 B4 B5 B6 B7
|
| B8 B9 .....
|
-----------------------------


My code :

--------------------------------------

Code:
wm title . "Toolbar Demonstration" 
wm geometry . 325x100

		
set count 0
proc add_frame title {
  global frame count w
  set frame .frame$count
  frame $frame -border 2 -relief groove
  label $frame.label -text $title
  pack  $frame       -side left -padx 2 -pady 2 -anchor n -fill x
  pack  $frame.label -side top  -padx 2 -pady 2
  incr count
}
proc add_button {title} {
  global frame count
  button $frame.$count -text $title 
  pack   $frame.$count -side left -pady 1 -padx 3 -fill x
  incr count
}

add_frame  "Button Set1"
add_button "  B1  "
add_button "  B2  "
add_button "  B3  "
add_button "  B4  "
add_button "  B5  "
add_button "  B6  "
add_button "  B7  "
add_button "  B8  "
add_button "  B9  "


------------------------

Plz help me. thanks in advance.

Last edited by pludi; 07-22-2010 at 02:09 AM.. Reason: code tags, please...
Login or Register to Ask a Question

Previous Thread | Next Thread

6 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell Script to delete files within a particular time frame under multiple sub folders

Greetings! I'm looking for starting information for a shell script. Here's my scenario: I have multiple folders(100) for example: /www/test/applications/app1/logs /www/test/applications/app2/logs Within these folders there are log files files that need to be deleted after a month. ... (3 Replies)
Discussion started by: whysolucky
3 Replies

2. Shell Programming and Scripting

TCL expect out string with multiple lines

Hello, I will be sending this command to a specific COMID: exp_send-i $COMID "fdisk -l | grep Disk | awk '{print $2}'" The command will produce this output: /dev/sda /dev/sdb etc.. the problem is how do I store the output in a variable in TCL, I am currently using this to grab the... (1 Reply)
Discussion started by: h0ujun
1 Replies

3. Shell Programming and Scripting

TCL/Expect using puts to add data to a file

Hi all, I'm trying to do something that might be basic, but it is not working for me, and I suspect I'm missing something. I appreciate if you can shed a light or offer an alternative. In expect script, I'm opening a file i.e: set file I have a simple proc: proc a {} { puts "Hello... (3 Replies)
Discussion started by: ydekel
3 Replies

4. Web Development

buttons links in frame

Happy X-Mas to all members... Hi, I have one html file page1.html as below <HTML> <HEAD> <TITLE>Utilities</TITLE> </HEAD> <FRAMESET ROWS="5%,95%"> <FRAME SRC="frames1.html" NAME=SIDEBAR> <FRAME SRC="frames2.html" NAME=SAMPLE> </FRAMESET> </HTML> ... (0 Replies)
Discussion started by: villain41
0 Replies

5. UNIX Desktop Questions & Answers

Buttons and menues like win95

I'v got some question about x managers. I'm using FreeBSD7 + Gnome + fluxbox. when i'm trying to apply some themes, it doesn't look like it should be. All my buttons and menus are look like win95). Whaat kind of lib i should install... what should i do? Here is two printscreens. For ex. My... (1 Reply)
Discussion started by: Levenson
1 Replies

6. Shell Programming and Scripting

frame multiple lines into one

Hi, i have a file with contents like below ( any number of entries can be there) 111 222 333 444 555 i need to make another file with single line like below: 111,222,333,444,555 (without ending , ) TIA Prvn (8 Replies)
Discussion started by: prvnrk
8 Replies
Login or Register to Ask a Question