ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/DC/UI.pm
(Generate patch)

Comparing deliantra/Deliantra-Client/DC/UI.pm (file contents):
Revision 1.235 by root, Thu May 25 16:35:42 2006 UTC vs.
Revision 1.236 by root, Thu May 25 16:54:29 2006 UTC

618 delete $child->{parent}; 618 delete $child->{parent};
619 $child->hide; 619 $child->hide;
620 620
621 $self->{children} = [ grep $_ != $child, @{ $self->{children} } ]; 621 $self->{children} = [ grep $_ != $child, @{ $self->{children} } ];
622 622
623 $self->check_size; 623 $self->check_size (1);
624 $self->update; 624 $self->update;
625} 625}
626 626
627sub clear { 627sub clear {
628 my ($self) = @_; 628 my ($self) = @_;
1101 col_expand => [], 1101 col_expand => [],
1102 @_, 1102 @_,
1103 ) 1103 )
1104} 1104}
1105 1105
1106sub children {
1107 grep $_, map @$_, grep $_, @{ $_[0]{children} }
1108}
1109
1106sub add { 1110sub add {
1107 my ($self, $x, $y, $child) = @_; 1111 my ($self, $x, $y, $child) = @_;
1108 1112
1109 $child->set_parent ($self); 1113 $child->set_parent ($self);
1110 $self->{children}[$y][$x] = $child; 1114 $self->{children}[$y][$x] = $child;
1111 1115
1112 $child->check_size; 1116 $self->check_size (1);
1113} 1117}
1114 1118
1115sub children {
1116 grep $_, map @$_, grep $_, @{ $_[0]{children} }
1117}
1118
1119# TODO: move to container class maybe? send childs a signal on removal? 1119# TODO: move to container class maybe? send children a signal on removal?
1120sub clear { 1120sub clear {
1121 my ($self) = @_; 1121 my ($self) = @_;
1122 1122
1123 my @children = $self->children; 1123 my @children = $self->children;
1124 delete $self->{children}; 1124 delete $self->{children};
1126 for (@children) { 1126 for (@children) {
1127 delete $_->{parent}; 1127 delete $_->{parent};
1128 $_->hide; 1128 $_->hide;
1129 } 1129 }
1130 1130
1131 $self->check_size (1);
1131 $self->update; 1132 $self->update;
1132} 1133}
1133 1134
1134sub get_wh { 1135sub get_wh {
1135 my ($self) = @_; 1136 my ($self) = @_;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines