--- deliantra/server/ext/widget.ext 2007/07/21 15:04:36 1.10 +++ deliantra/server/ext/widget.ext 2007/07/22 20:08:38 1.12 @@ -34,34 +34,6 @@ } } -sub demo_map { - my ($ns) = @_; - - my $ws = $ns->{csc} = $ns->new_widgetset; - - my $w = $ws->new (Toplevel => - w => 200, - h => 200, - x => "center", - y => "center", - title => "Worldmap", - has_close_button => 1, - on_delete => sub { - $ws->destroy; - }, - ); - - my $face = cf::face::find "res/worldmap.jpg"; - $ns->send_face ($face); - - $w->add (my $sw = $ws->new (ScrolledWindow => scroll_x => 1, scroll_y => 1)); - $sw->add (my $fixed = $ws->new (Fixed => expand => 1)); - $fixed->add ($ws->new (Face => expand => 1, size_w => undef, size_h => undef, face => $face), abs => 0, 0, rel => 1, 1); - $fixed->add ($ws->new (Label => text => "lb1"), abs => 10, 10, rel => 1, 1); - - $w->show; -} - sub csc_start { my ($ns) = @_; @@ -120,8 +92,6 @@ my $ns = $pl->ns; return unless $ns->{can_widget}; - - demo_map $ns; #csc_start $ns; }, ); @@ -157,7 +127,7 @@ my $ws = bless { id => $id, ns => $self, - w => {}, + _w => {}, }, "ext::widget::set"; $ws->msg (ws_n => id => $id); @@ -196,7 +166,7 @@ my $id = ++$self->{ns}{id}; - my $proxy = $self->{w}{$id} = bless { + my $proxy = $self->{_w}{$id} = bless { id => $id, }, "ext::widget::proxy"; @@ -210,7 +180,7 @@ } $self->msg (ws_c => - ws => $self->{w}{id}, + ws => $proxy->{id}, id => $id, class => $class, args => \%args, @@ -228,9 +198,10 @@ delete $self->{ns}{widget}{$self->{id}}; + #warn "DES<$self> $self->{ws}\n";#d# if (my $ws = $self->{ws}) { - delete $ws->{w}{$self->{id}}; $self->msg (w_c => name => "destroy"); + delete $ws->{_w}{$self->{id}}; } } @@ -275,9 +246,9 @@ } sub set { - my ($self, $member, $value) = @_; + my ($self, @kv) = @_; - $self->msg (w_s => attr => [ [$member, $value] ]); + $self->msg (w_s => attr => \@kv); } sub get {