Sponsored Content
Top Forums UNIX for Advanced & Expert Users Add multiple buttons in frame using TCL/TK. Post 302439077 by singh.mmt on Wednesday 21st of July 2010 04:58:23 PM
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...
 

6 More Discussions You Might Find Interesting

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

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

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

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

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

6. 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
ttk::frame(n)							 Tk Themed Widget						     ttk::frame(n)

__________________________________________________________________________________________________________________________________________________

NAME
ttk::frame - Simple container widget SYNOPSIS
ttk::frame pathName ?options? _________________________________________________________________ DESCRIPTION
A ttk::frame widget is a container, used to group other widgets together. STANDARD OPTIONS
-class -cursor -takefocus -style See the ttk_widget manual entry for details on the standard options. WIDGET-SPECIFIC OPTIONS [-borderwidth borderWidth] The desired width of the widget border. Defaults to 0. [-relief relief] One of the standard Tk border styles: flat, groove, raised, ridge, solid, or sunken. Defaults to flat. [-padding padding] Additional padding to include inside the border. [-width width] If specified, the widget's requested width in pixels. [-height height] If specified, the widget's requested height in pix- els. WIDGET COMMAND
Supports the standard widget commands configure, cget, identify, instate, and state; see ttk::widget(n). NOTES
Note that if the pack, grid, or other geometry managers are used to manage the children of the frame, by the GM's requested size will nor- mally take precedence over the frame widget's -width and -height options. pack propagate and grid propagate can be used to change this. SEE ALSO
ttk::widget(n), ttk::labelframe(n), frame(n) KEYWORDS
widget, frame, container Tk 8.5 ttk::frame(n)
All times are GMT -4. The time now is 02:18 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy