… | |
… | |
7 | use Glib::Object::Subclass |
7 | use Glib::Object::Subclass |
8 | Gtk2::Frame; |
8 | Gtk2::Frame; |
9 | |
9 | |
10 | sub new { |
10 | sub new { |
11 | my ($self, %arg) = @_; |
11 | my ($self, %arg) = @_; |
|
|
12 | |
12 | $self = $self->Glib::Object::new; |
13 | $self = $self->Glib::Object::new; |
13 | $self->{$_} = delete $arg{$_} for keys %arg; |
14 | $self->{$_} = delete $arg{$_} for keys %arg; |
14 | |
15 | |
15 | $self->signal_connect (destroy => sub { |
16 | $self->signal_connect (destroy => sub { |
16 | delete $::config->{rooms}{$self->{channel}}; |
17 | delete $::config->{rooms}{$self->{channel}}; |
… | |
… | |
42 | |
43 | |
43 | $vbox->pack_start ((my $button = new_with_label Gtk2::Button "New Game"), 0, 1, 0); |
44 | $vbox->pack_start ((my $button = new_with_label Gtk2::Button "New Game"), 0, 1, 0); |
44 | $button->signal_connect (clicked => sub { $self->new_game }); |
45 | $button->signal_connect (clicked => sub { $self->new_game }); |
45 | |
46 | |
46 | $vbox->pack_start ((my $sw = new Gtk2::ScrolledWindow), 1, 1, 0); |
47 | $vbox->pack_start ((my $sw = new Gtk2::ScrolledWindow), 1, 1, 0); |
47 | $sw->set_policy("automatic", "always"); |
48 | $sw->set_policy ("automatic", "always"); |
48 | |
49 | |
49 | $sw->add ($self->{userlist} = new userlist); |
50 | $sw->add ($self->{userlist} = new userlist); |
50 | |
51 | |
51 | $self; |
52 | $self; |
52 | } |
53 | } |