6 use lib
'../../perllib', '../perllib', 'perllib', `fvwm-perllib dir`;
9 my $mode = shift || "--autodetect-gtk"; # -t|--text-only -x|--x-dialog
11 my $title = "Commands of fvwm-$FVWM::Commands::VERS";
12 my $commands_text = join('', map {
13 sprintf " %-21s - %s\n", $_->{name
}, $_->{descr
}
14 } @FVWM::Commands
::LIST
);
17 print "$title:\n\n$commands_text";
21 if ($mode =~ /-x/ || !eval "use Gtk2 -init; 1;") {
22 require FVWM
::Module
::Toolkit
;
23 FVWM
::Module
::Toolkit
->show_message($commands_text, $title, 1);
27 my %cursor_to_stock_icon = (
29 DESTROY
=> 'gtk-close',
31 RESIZE
=> 'gtk-fullscreen',
32 MOVE
=> 'gtk-leave-fullscreen',
35 my $command_entries = Gtk2
::ListStore
->new(('Glib::String') x
3);
36 foreach (@FVWM::Commands
::LIST
) {
37 $command_entries->set($command_entries->append,
38 0 => $cursor_to_stock_icon{$_->{cursor
}} || 'gtk-no',
44 my $combo_box = Gtk2
::ComboBox
->new($command_entries);
45 my $renderer = Gtk2
::CellRendererPixbuf
->new;
46 $combo_box->pack_start($renderer, 0);
47 $combo_box->add_attribute($renderer, stock_id
=> 0);
48 $renderer = Gtk2
::CellRendererText
->new;
49 $combo_box->pack_start($renderer, 1);
50 $combo_box->add_attribute($renderer, text
=> 1);
51 $renderer = Gtk2
::CellRendererText
->new;
52 $renderer->set(scale
=> 0.8);
53 $combo_box->pack_start($renderer, 0);
54 $combo_box->add_attribute($renderer, text
=> 2);
56 my $window = Gtk2
::Dialog
->new;
57 $window->set_title($title);
58 $window->add_button('gtk-close' => 'close');
60 $window->vbox->add($combo_box);