Any *nix testers available out there, please? - script below
| From: | Steph | Date: | Mon, 25 Feb 2002 20:22:33 +0000 |
| Subject: | Any *nix testers available out there, please? - script below | ||
| Groups: | php.gtk.doc php.gtk.general | ||
| Request: | Send a blank email to php-gtk-doc+get-423@lists.php.net to get a copy of this message | ||
I need to know what happens when:
a) 5 is selected and the mouse button immediately released,
b) a number below 5 is selected and then dragged up to 5 and released,
c) a number below 5 is selected and then dragged beyond 5 and released,
d) a number above 5 is selected and then drag extended to 5 and released,
e) a number above 5 is selected and the drag extended below 5 and released.
I'm afraid all these need to be single runs to get the start_selection() working. Had to put a
counter on it to avoid fails.
& btw it does nothing AT ALL on doze.
<?
dl("php_gtk." . (strstr(PHP_OS, "WIN") ? "dll" : "so"));
$x = 0;
function echo_it($list, $selection, &$x) {
global $item;
if($x < 1) {
$list->start_selection();
}
$x++;
if($selection == $item[5]) $list->end_drag_selection();
$label = $selection->child;
echo $label->get()."\n";
}
$window = &new GtkWindow();
$window->set_position(GTK_WIN_POS_CENTER);
$window->connect_object("destroy", array("gtk", "main_quit"));
$box = &new GtkVBox();
$window->add($box);
$hbox = &new GtkHBox();
$box->pack_start($hbox);
$scrollwin = &new GtkScrolledWindow();
$scrollwin->set_policy(GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
$scrollwin->set_usize(150, 300);
$hbox->pack_start($scrollwin);
$list = &new GtkList();
$list->set_selection_mode(GTK_SELECTION_EXTENDED);
for ($i = 0; $i < 100; $i++) {
$item[] = &new GtkListItem("Item $i");
$item[$i]->show();
}
$list->append_items($item);
$list->connect('select-child', 'echo_it', &$x);
$scrollwin->add_with_viewport($list);
$list->set_focus_vadjustment($scrollwin->get_vadjustment());
$scrollwin->show_all();
$button = &new GtkButton('Close');
$button->connect_object('clicked', array('gtk', 'main_quit'));
$box->pack_end($button);
$box->show_all();
$window->show_all();
gtk::main();
?>