in reply to Calling a TK Method by reference

According to the docs, the place method returns an empty string as result.

Which would mean that $res == \"";. Try doing this instead:

my $listbox; sub some_name { $listbox = $search_frame->ListBox( ... ); $listbox->place( ... ); } $listbox->insert( ... );
Update: $search_frame->ListBox( ... );

Replies are listed 'Best First'.
Re^2: Calling a TK Method by reference
by eserte (Deacon) on Jul 09, 2004 at 09:11 UTC
    I don't think this is true --- every Tk geometry manager returns the widget reference so one can write
    $widget = $parent->Widget->pack(...); $widget = $parent->Widget->grid(...); $widget = $parent->Widget->place(...);
      update: The docs are wrong.

      I did not expect it either, and I haven't tested it, but this is from Tk::place (emphasis mine):

      $slave->place?(-option=>value?, -option=>value, ...?)? The place method arranges for the placer to manage the geometry of $slave. The remaining arguments consist of one or more -option=>value pairs that specify the way in which $slave's geome- try is managed. If the placer is already managing $slave, then the -option=>value pairs modify the configuration for $slave. The place method returns an empty string as result.
        Then the doc is wrong. Which is not surprising, because it is auto-generated from the original Tcl/Tk docs, and in Tcl/Tk there's no need to write something like
        set bla [pack [label .l -text hello]]
        as there are no widget references, just path names.

        Who will supply a bug report in RT? :-)