
On Tue, Mar 25, 2008 at 07:59:41PM -0400, Justin Haygood wrote:
I'm trying to get the value of a YUI TextEntry (all in Perl).
I created the TextEntry via:
my $TextInput = TextEntry("Some Text","");
This let me add it to the VBOX:
my $c = VBox( $TextInput, PushButton("&OK") );
UI->OpenDialog($c); UI->UserInput(); UI->CloseDialog();
However, you can't get the value from either:
$value = $TextInput->Value; // Most Logical $value = UI->QueryWidget( $TextInput, "Value" ); // Second Most Logical
What do I have to do in order to do this? Is this just incomplete Perl bindings?
Hi Justin, my $TextInput = TextEntry(id("Input"), "Some Text",""); This does not create the widget. It only creates a recipe (a term) for the widget. So $TextInput->Value does not work. However, $TextInput->name returns "TextEntry". Same with all the other widgets. The widgets only live in the dialogs, and you do not get objects representing them. You can only access them via UI functions using their ids as handles. So UI->QueryWidget( $TextInput, "Value" ) does not work either, but UI->QueryWidget(id("Input"), Symbol("Value") ) does. (The "Symbol" is a necessity that I forgot to do away with. In YCP it is just `Value vs "Value") The fact that widgets only live inside dialogs also means that after you close a dialog, you can no longer query its widgets. So QueryWidget must come before CloseDialog. Attached is a working version. -- Martin Vidner, YaST developer http://en.opensuse.org/User:Mvidner Kuracke oddeleni v restauraci je jako fekalni oddeleni v bazenu