--- deliantra/Deliantra-Client/DC/Protocol.pm 2006/05/27 19:49:07 1.6 +++ deliantra/Deliantra-Client/DC/Protocol.pm 2006/05/28 19:25:55 1.8 @@ -327,7 +327,12 @@ my $dialog = new CFClient::UI::FancyFrame title => "Query", - child => my $vbox = new CFClient::UI::VBox; + child => my $vbox = new CFClient::UI::VBox, + on_visibility_change => sub { + my ($self, $visible) = @_; + $self->center if $visible; + }, + ; $vbox->add (new CFClient::UI::Label max_w => $::WIDTH * 0.4, @@ -338,7 +343,7 @@ $vbox->add (my $hbox = new CFClient::UI::HBox); $hbox->add (new CFClient::UI::Button text => "No", - connect_activate => sub { + on_activate => sub { $self->send ("reply n"); $dialog->destroy; $self->{map_widget}->focus_in; @@ -346,7 +351,7 @@ ); $hbox->add (new CFClient::UI::Button text => "Yes", - connect_activate => sub { + on_activate => sub { $self->send ("reply y"); $dialog->destroy; }, @@ -357,7 +362,7 @@ } elsif ($flags & CS_QUERY_SINGLECHAR) { $dialog->{tooltip} = "Press a key (click on the entry to make sure it has keyboard focus)"; $vbox->add (my $entry = new CFClient::UI::Entry - connect_changed => sub { + on_changed => sub { $self->send ("reply $_[1]"); $dialog->destroy; }, @@ -370,7 +375,7 @@ $vbox->add (my $entry = new CFClient::UI::Entry $flags & CS_QUERY_HIDEINPUT ? (hiddenchar => "*") : (), - connect_activate => sub { + on_activate => sub { $self->send ("reply $_[1]"); $dialog->destroy; }, @@ -379,7 +384,7 @@ $entry->focus_in; } - $dialog->show_centered; + $dialog->show; } sub drawinfo {