summaryrefslogtreecommitdiff
path: root/src/gui/char_server.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2004-12-19 12:41:27 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2004-12-19 12:41:27 +0000
commit86e10f867bc0531cdc2007524aa7757d7d594e7d (patch)
tree0e37ad5c038ca930d6a8beba557427b9ad34de8b /src/gui/char_server.cpp
parent129040251c8242bd4b56f4fc6b107017d62bca3c (diff)
downloadmana-86e10f867bc0531cdc2007524aa7757d7d594e7d.tar.gz
mana-86e10f867bc0531cdc2007524aa7757d7d594e7d.tar.bz2
mana-86e10f867bc0531cdc2007524aa7757d7d594e7d.tar.xz
mana-86e10f867bc0531cdc2007524aa7757d7d594e7d.zip
More refining of windows.
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;