ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/gde/GCE/StackView.pm
(Generate patch)

Comparing deliantra/gde/GCE/StackView.pm (file contents):
Revision 1.5 by elmex, Fri Mar 10 20:32:47 2006 UTC vs.
Revision 1.7 by elmex, Sun Mar 12 14:39:19 2006 UTC

22sub INIT_INSTANCE { 22sub INIT_INSTANCE {
23 my ($self) = @_; 23 my ($self) = @_;
24 24
25 $self->pack_start (my $sw = Gtk2::ScrolledWindow->new, 1, 1, 0); 25 $self->pack_start (my $sw = Gtk2::ScrolledWindow->new, 1, 1, 0);
26 $sw->add_with_viewport ($self->{stackbox} = Gtk2::VBox->new); 26 $sw->add_with_viewport ($self->{stackbox} = Gtk2::VBox->new);
27 $sw->set_policy ('automatic', 'automatic');
27} 28}
28 29
29sub set_stack { 30sub set_stack {
30 my ($self, $mapedit, $x, $y) = @_; 31 my ($self, $mapedit, $x, $y) = @_;
31 32
73 }); 74 });
74 }; 75 };
75 76
76 $hb->pack_start (my $elemhdl = new Gtk2::Button, 0, 0, 0); 77 $hb->pack_start (my $elemhdl = new Gtk2::Button, 0, 0, 0);
77 $elemhdl->add (my $hb2 = Gtk2::HBox->new); 78 $elemhdl->add (my $hb2 = Gtk2::HBox->new);
79 $elemhdl->signal_connect (clicked => sub {
80 $::MAINWIN->update_attr_editor ($a, sub {
81 $mapedit->change_begin (ref $self);
82 $mapedit->change_stack ($x, $y, $stack);
83 # XXX: Put this into a generic function!!! See also EditTools.pm
84 # FIXME: Fix the automatic update on undo here!
85 if (my $changeset = $mapedit->change_end) {
86 splice @{ $mapedit->{undo_stack} ||= [] },
87 $mapedit->{undo_stack_pos}++, 1e6,
88 $changeset;
89 }
90 });
91 });
78 92
79 $hb2->pack_start (my $img = (new_from_pixbuf Gtk2::Image $pb), 0, 0, 0); 93 $hb2->pack_start (my $img = (new_from_pixbuf Gtk2::Image $pb), 0, 0, 0);
80 $img->set_alignment (0, 0.5); 94 $img->set_alignment (0, 0.5);
81 95
82 $hb2->pack_start (my $lbl = Gtk2::Label->new ($a->{_name}), 0, 0, 0); 96 $hb2->pack_start (my $lbl = Gtk2::Label->new ($a->{_name}), 0, 0, 0);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines