ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/kgsueme/kgsueme/app.pl
(Generate patch)

Comparing kgsueme/kgsueme/app.pl (file contents):
Revision 1.12 by pcg, Sun May 23 12:37:51 2004 UTC vs.
Revision 1.13 by pcg, Sat May 29 02:01:43 2004 UTC

32 $self->listen ($self->{conn}, qw(login userpic idle_warn msg_chat)); 32 $self->listen ($self->{conn}, qw(login userpic idle_warn msg_chat));
33 33
34 $self->{roomlist} = new roomlist conn => $self->{conn}, app => $self; 34 $self->{roomlist} = new roomlist conn => $self->{conn}, app => $self;
35 35
36 $self->set_title ('kgsueme'); 36 $self->set_title ('kgsueme');
37 gtk::state $self, "main::window", undef, window_size => [400, 400]; 37 gtk::state $self, "main::window", undef, window_size => [400, 500];
38 $self->signal_connect (destroy => sub { %{$_[0]} = () }); 38 $self->signal_connect (destroy => sub { %{$_[0]} = () });
39 $self->signal_connect (delete_event => sub { main_quit Gtk2; 1 }); 39 $self->signal_connect (delete_event => sub { main_quit Gtk2; 1 });
40 40
41 $self->add (my $vbox = new Gtk2::VBox); 41 $self->add (my $vbox = new Gtk2::VBox);
42 42
62 62
63 $hbox->add (new Gtk2::Label "Password"); 63 $hbox->add (new Gtk2::Label "Password");
64 $hbox->add ($self->{password} = new Gtk2::Entry); 64 $hbox->add ($self->{password} = new Gtk2::Entry);
65 $self->{password}->set_visibility(0); 65 $self->{password}->set_visibility(0);
66 66
67 $vbox->pack_start ((my $vpane = new Gtk2::VPaned), 1, 1, 0);
68 $vpane->set (position_set => 1);
69 gtk::state $vpane, "main::vpane", undef, position => 250;
70
71 $vbox->pack_start(($self->{status} = new Gtk2::Statusbar), 0, 1, 0);
72
67 $self->{gamelist} = new gamelist conn => $self->{conn}, app => $self; 73 $self->{gamelist} = new gamelist conn => $self->{conn}, app => $self;
68 $vbox->pack_start ($self->{gamelist}, 1, 1, 0); 74 $vpane->pack1 ($self->{gamelist}, 1, 1);
69 75
70 $vbox->pack_start(($self->{status} = new Gtk2::Statusbar), 0, 1, 0); 76 $self->{rooms} = new Gtk2::Notebook;
77
78 $vpane->pack2 ($self->{rooms}, 1, 1);
71 79
72 $self->show_all; 80 $self->show_all;
73 81
74 $self; 82 $self;
75} 83}
191} 199}
192 200
193sub open_room { 201sub open_room {
194 my ($self, %arg) = @_; 202 my ($self, %arg) = @_;
195 203
204 my $room = $self->{room}{$arg{channel}} ||= do {
196 ($self->{room}{$arg{channel}} ||= new room %arg, conn => $self->{conn}, app => $self) 205 my $room = new room %arg, conn => $self->{conn}, app => $self;
197 ->join; 206 $room->show_all;
207 $self->{rooms}->append_page ($room, new Gtk2::Label $room->{name});
208 $room;
209 };
198 Scalar::Util::weaken $self->{room}{$arg{channel}}; 210 Scalar::Util::weaken $self->{room}{$arg{channel}};
211
212 $room->join;
199 $self->{room}{$arg{channel}}; 213 $self->{room}{$arg{channel}};
200} 214}
201 215
202sub open_user { 216sub open_user {
203 my ($self, %arg) = @_; 217 my ($self, %arg) = @_;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines