beetlebug▾
/

winfo parent

Gives the parent of a widget.

winfo parent WINDOW

Description

The result is the path name of the parent. . has no parent and gives an empty string.

Returns

A widget name, or an empty string.

Examples

% frame .pa
> frame .pa.ch
> list [winfo parent .pa.ch] [winfo parent .]
.pa {}

Errors

% winfo parent
wrong # args: should be "winfo parent window"
-errorcode NONE

% winfo parent .nope
bad window path name ".nope"
-errorcode NONE

Facts

Capability
None.
Tcl release
Tcl 9.1 and 8.6.
Since
ztk 1.0.0-beta.1