summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYves Duret <yduret@mandriva.com>2002-01-29 16:13:04 +0000
committerYves Duret <yduret@mandriva.com>2002-01-29 16:13:04 +0000
commit68cb104a88ae6fef8298acab166dccd464d170b7 (patch)
tree1cf1f7b49a244357a5086dcb24055a6d8576f2b4
parent58be4a692e597d85219f921181c0e7f01f9844cc (diff)
downloaddrakx-68cb104a88ae6fef8298acab166dccd464d170b7.tar
drakx-68cb104a88ae6fef8298acab166dccd464d170b7.tar.gz
drakx-68cb104a88ae6fef8298acab166dccd464d170b7.tar.bz2
drakx-68cb104a88ae6fef8298acab166dccd464d170b7.tar.xz
drakx-68cb104a88ae6fef8298acab166dccd464d170b7.zip
added some snipet coe for example
-rwxr-xr-xdocs/interactive/ask_from29
-rwxr-xr-xdocs/interactive/ask_from_list27
-rwxr-xr-xdocs/interactive/ask_from_listf27
-rwxr-xr-xdocs/interactive/ask_from_treelist27
-rwxr-xr-xdocs/interactive/wait_message13
5 files changed, 123 insertions, 0 deletions
diff --git a/docs/interactive/ask_from b/docs/interactive/ask_from
new file mode 100755
index 000000000..dad69247e
--- /dev/null
+++ b/docs/interactive/ask_from
@@ -0,0 +1,29 @@
+#!/usr/bin/perl
+# Yves Duret <yduret at mandrakesoft.com>
+# license: GPL
+
+use lib qw(/usr/lib/libDrakX);
+use interactive;
+
+my $irq=1;
+my $login;
+my $login2="editable";
+my $check;
+my $range=57;
+
+my $in = 'interactive'->vnew(undef, 'default');
+
+$in->ask_from("window title - ask_from",
+ "message\nexamples of utilisation of ask_from",
+ [
+ { label => "enter scalar", val => \$irq },
+ { label => "combo (type=>combo optionnal)", val => \$login, list => ['Netherlands', 'France', 'Belgium', 'Italy', 'UK'], type => 'combo'},
+ { label => "choose from list editable and sorted", val => \$login2, list => ['Netherlands', 'France', 'Belgium', 'Italy', 'UK'], not_edit => 0, sort => 1},
+ { label => "check box", val => \$check, type => "bool", text => "text" },
+ { label => "range", val => \$range, type => 'range', min => 0, max => 100 },
+ ],
+ complete => sub { print "complete\n";print "$irq\n$login\n$range\n"; },
+# focus_out => sub { print "focus_out\n"},
+# changed => sub { print "changed\n"; },
+ ) or $in->exit(0);
+$in->exit(0);
diff --git a/docs/interactive/ask_from_list b/docs/interactive/ask_from_list
new file mode 100755
index 000000000..63c0ee996
--- /dev/null
+++ b/docs/interactive/ask_from_list
@@ -0,0 +1,27 @@
+#!/usr/bin/perl
+# Yves Duret <yduret at mandrakesoft.com>
+# license: GPL
+
+use lib qw(/usr/lib/libDrakX);
+use common;
+use interactive;
+
+my %l = (
+ 0 => "Welcome To Crackers",
+ 1 => "Poor",
+ 2 => "Low",
+ 3 => "Medium",
+ 4 => "High",
+ 5 => "Paranoid",
+ );
+
+my $in = 'interactive'->vnew(undef, 'default');
+
+my $level = $in->ask_from_list("window title - ask_from_list",
+ "radio button\nexamples of utilisation of ask_from_list",
+ [ values %l ], $l{2}
+ ) or $in->exit(0);
+
+print "$level\n";
+$in->exit(0);
+
diff --git a/docs/interactive/ask_from_listf b/docs/interactive/ask_from_listf
new file mode 100755
index 000000000..077540b49
--- /dev/null
+++ b/docs/interactive/ask_from_listf
@@ -0,0 +1,27 @@
+#!/usr/bin/perl
+# Yves Duret <yduret at mandrakesoft.com>
+# license: GPL
+
+use lib qw(/usr/lib/libDrakX);
+use interactive;
+use Data::Dumper;
+
+my $in = 'interactive'->vnew(undef, 'default');
+
+my @m=(
+ { description => "dhcpcd",
+ c => 1},
+ { description => "dhcpxd",
+ c => 3},
+ { description => "dhcp-client",
+ c => 4},
+ );
+my $f = $in->ask_from_listf(_("ask_from_listf"),
+ _("Which dhcp client do you want to use?\nDefault is dhcpcd"),
+ sub { $_[0]{description} },
+ \@m );
+
+print Data::Dumper->Dump([$f],['f']) . "\n";
+
+$in->exit(0);
+
diff --git a/docs/interactive/ask_from_treelist b/docs/interactive/ask_from_treelist
new file mode 100755
index 000000000..ade7141d4
--- /dev/null
+++ b/docs/interactive/ask_from_treelist
@@ -0,0 +1,27 @@
+#!/usr/bin/perl
+# Yves Duret <yduret at mandrakesoft.com>
+# license: GPL
+
+use lib qw(/usr/lib/libDrakX);
+use common;
+use interactive;
+
+my $in = 'interactive'->vnew(undef, 'default');
+my $foo = $in->ask_from_treelist("window title - ask_from_treelist",
+ "message\nexamples of utilisation of ask_from_treelist",
+ '|',
+ ['Custom',
+ 'Other|Unlisted',
+ 'Matrox|Millennium II=>Matrox Millennium II',
+ 'Matrox|Millennium G200=>Matrox Millennium G200',
+ 'Matrox|Millennium G400=>Matrox Millennium G400',
+ 'Matrox|Millennium G450=>Matrox Millennium G450',
+ 'Matrox|Millennium G550=>Matrox Millennium G550',
+ 'Sun|FFB 67MHz Creator=>Sun FFB 67MHz Creator',
+ 'Sun|FFB 67MHz Creator 3D=>Sun FFB 67MHz Creator 3D',
+ 'Sun|FFB 75MHz Creator 3D=>Sun FFB 75MHz Creator 3D',
+ ],
+ 'Custom'
+ ) or $in->exit(0);
+print "$foo\n";
+$in->exit(0);
diff --git a/docs/interactive/wait_message b/docs/interactive/wait_message
new file mode 100755
index 000000000..0caec4471
--- /dev/null
+++ b/docs/interactive/wait_message
@@ -0,0 +1,13 @@
+#!/usr/bin/perl
+# Yves Duret <yduret at mandrakesoft.com>
+# license: GPL
+
+use lib qw(/usr/lib/libDrakX);
+use interactive;
+
+my $in = 'interactive'->vnew(undef, 'default');
+my $wait = $in->wait_message('wainting title', _("Moving files to the new partition"));
+sleep(3);
+$wait->set(_("Removing"));
+sleep(3);
+$in->exit(0);