Sophie

Sophie

distrib > Mageia > 3 > i586 > media > core-release-src > by-pkgid > 00da6a3f1d759e5d4c3679a765a54b38 > files > 5

perl-Curses-UI-0.960.900-2.mga3.src.rpm

--- Curses-UI-0.95/lib/Curses/UI/Popupmenu.pm.pix	2006-10-16 16:08:24.000000000 +0200
+++ Curses-UI-0.95/lib/Curses/UI/Popupmenu.pm	2006-10-16 16:10:57.000000000 +0200
@@ -309,6 +309,27 @@
     return $value;
 }
 
+sub id()
+{
+    my $this = shift;
+
+    return $this->{-selected};
+}
+
+sub set_selection() 
+{
+    my $this = shift;
+    my $id = shift;
+
+    my $changed = (not defined $this->{-selected} or
+			   ($this->{-selected} != $id));
+    $this->{-selected} = $id;
+    $this->run_event('-onchange') if $changed;
+    $this->intellidraw;
+
+    return $this;
+}
+
 sub select_next()
 {
     my $this = shift;
@@ -505,6 +526,14 @@
 
 This method will return the currently selected value.
 
+=item * B<id> ( )
+
+This method will return the index of the currently selected value.
+
+=item * B<set_selection> ( INDEX )
+
+This method marks the item at the position specified as selected.
+
 =item * B<onChange> ( CODEREF )
 
 This method can be used to set the B<-onchange> event handler