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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I get the list of widgets in a frame?

Status
Not open for further replies.

annox

MIS
Apr 18, 2003
6
TW
I create lots of widget in a frame, and there are too much to remember.
So, Is there any command that can return the list of widgets in a frame?

I'll be so appreciate if someone could teach me.
 
winfo children <frame name>

from the help file: &quot;Returns a list containing the path names of all the children of window. Top-level windows are returned as children of their logical parents. The list is in stacking order, with the lowest window first, except for Top-level windows which are not returned in stacking order. Use the wm stackorder command to query the stacking order of Top-level windows.&quot;

Bob Rashkin
rrashkin@csc.com
 
In complement to Bong answer:
If you need all levels of children:
Code:
  proc clist {w}   {
    set clist {}
    foreach child [winfo children $w]     {
      lappend clist $child
      set children [clist $child]
      if {[llength $children] > 0}       { eval lappend clist $children }
    }
    return $clist
  }

  puts [clist .]
HTH

ulis
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top