aboutsummaryrefslogtreecommitdiffstats
path: root/feature-tests/sbar_test.pl
blob: 121bc522a08c200ffb7b9cfda92ee47af484b66b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
use strict;
use warnings;

use Irssi;
use Irssi::TextUI;              # for sbar_items_redraw


sub foo_sb {
    my ($sb_item, $get_size_only) = @_;

    # my $prompt = Irssi::parse_special('$L');
    # my $cmdchars = Irssi::parse_special('$K');

    # my $sb = '';

    # if ($prompt =~ /^(.)ws (.+)$/i && index($cmdchars,$1) != -1) {
    #     my $arg = $2;
    #     my $wins = find_wins($arg);

    #     foreach my $win (@$wins) {
    #         $sb .= $win->{text} . ' ';
    #     }
    #     $sb =~ s/ $//;
    # }
    my $sb = '%gmoo%n';
    print "Getsize: $get_size_only";
    $sb_item->default_handler($get_size_only, "{sb $sb}", '', 0);
}

Irssi::statusbar_item_register ('foo_bar', 0, 'foo_sb');

__END__
# Name                           Type   Placement Position Visible
# window                         window bottom    1        active
# window_inact                   window bottom    1        inactive
# prompt                         root   bottom    0        always
# topic                          root   top       1        always

# Statusbar: prompt
# Type     : root
# Placement: bottom
# Position : 0
# Visible  : always
# Items    : Name                                Priority  Alignment
#          : prompt                              0         left
#          : prompt_empty                        0         left
#          : input                               10        left
#
# STATUSBAR <name> ENABLE
# STATUSBAR <name> DISABLE
# STATUSBAR <name> RESET
# STATUSBAR <name> TYPE window|root
# STATUSBAR <name> PLACEMENT top|bottom
# STATUSBAR <name> POSITION <num>
# STATUSBAR <name> VISIBLE always|active|inactive
# STATUSBAR <name> ADD
#                  [-before | -after <item>] [-priority #]
#                  [-alignment left|right] <item>
#
# STATUSBAR <name> REMOVE <item>
#
# Commands for modifying the statusbar.
#
# /STATUSBAR
#    - Display all statusbars.
#
# /STATUSBAR <name>
#    - display elements of statusbar <name>
#
# Irssi commands:
# statusbar add     statusbar enable    statusbar position  statusbar reset
# statusbar visible statusbar disable   statusbar placement statusbar remove
# statusbar type