summaryrefslogtreecommitdiff
path: root/src/gui/char_server.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/char_server.cpp')
-rw-r--r--src/gui/char_server.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/gui/char_server.cpp b/src/gui/char_server.cpp
index 342836e4..6664be84 100644
--- a/src/gui/char_server.cpp
+++ b/src/gui/char_server.cpp
@@ -30,8 +30,8 @@ char server[30];
int showServerList = 1;
-ServerSelectDialog::ServerSelectDialog():
- Window("Select Server")
+ServerSelectDialog::ServerSelectDialog(gcn::Container *parent):
+ Window(parent, "Select Server")
{
serverListModel = new ServerListModel();
serverList = new gcn::ListBox(serverListModel);
@@ -63,6 +63,8 @@ ServerSelectDialog::ServerSelectDialog():
// Select first server
serverList->setSelected(1);
}
+
+ setLocationRelativeTo(getParent());
}
ServerSelectDialog::~ServerSelectDialog()
@@ -74,11 +76,6 @@ ServerSelectDialog::~ServerSelectDialog()
delete cancelButton;
}
-void ServerSelectDialog::init()
-{
- setLocationRelativeTo(getParent());
-}
-
void ServerSelectDialog::action(const std::string& eventId)
{
if (eventId == "ok") {
@@ -103,9 +100,7 @@ std::string ServerListModel::getElementAt(int i) {
void char_server() {
- ServerSelectDialog *dialog = new ServerSelectDialog();
- guiTop->add(dialog);
- dialog->init();
+ ServerSelectDialog *dialog = new ServerSelectDialog(guiTop);
state = LOGIN;