summaryrefslogtreecommitdiff
path: root/src/textfile_gui.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2013-05-26 19:23:42 +0000
committerfrosch <frosch@openttd.org>2013-05-26 19:23:42 +0000
commit56e4a8c4d63b19cb037ac1ba64c5a4d7fde4350b (patch)
treef3e5c225182fce7a451af4e09e943920e0f1cc3c /src/textfile_gui.cpp
parentb10a4f151aa534860dcc61ecf8cba7b3589e6281 (diff)
downloadopenttd-56e4a8c4d63b19cb037ac1ba64c5a4d7fde4350b.tar.xz
(svn r25287) -Codechange: Keep a reference to the WindowDesc in the Window after construction.
Diffstat (limited to 'src/textfile_gui.cpp')
-rw-r--r--src/textfile_gui.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/textfile_gui.cpp b/src/textfile_gui.cpp
index 91adc1239..87b1add35 100644
--- a/src/textfile_gui.cpp
+++ b/src/textfile_gui.cpp
@@ -42,19 +42,19 @@ static const NWidgetPart _nested_textfile_widgets[] = {
};
/** Window definition for the textfile window */
-static const WindowDesc _textfile_desc(
+static WindowDesc _textfile_desc(
WDP_CENTER, 630, 460,
WC_TEXTFILE, WC_NONE,
0,
_nested_textfile_widgets, lengthof(_nested_textfile_widgets)
);
-TextfileWindow::TextfileWindow(TextfileType file_type) : Window(), file_type(file_type)
+TextfileWindow::TextfileWindow(TextfileType file_type) : Window(&_textfile_desc), file_type(file_type)
{
- this->CreateNestedTree(&_textfile_desc);
+ this->CreateNestedTree();
this->vscroll = this->GetScrollbar(WID_TF_VSCROLLBAR);
this->hscroll = this->GetScrollbar(WID_TF_HSCROLLBAR);
- this->FinishInitNested(&_textfile_desc);
+ this->FinishInitNested();
this->GetWidget<NWidgetCore>(WID_TF_CAPTION)->SetDataTip(STR_TEXTFILE_README_CAPTION + file_type, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS);
}