source: PSPA/Interface_Web/trunk/pspaWT/sources/userInterface/src/GWt_console.cc @ 257

Last change on this file since 257 was 257, checked in by garnier, 11 years ago

refactoring

File size: 550 bytes
Line 
1#include "GWt_console.h"
2
3#include <Wt/WApplication>
4#include <Wt/WText>
5
6GWt_console::GWt_console()
7:WContainerWidget()
8{
9  setObjectName("console");
10}
11
12
13GWt_console::~GWt_console()
14{
15}
16
17
18void GWt_console::addConsoleMessage(WString msg) {
19
20  WText *w = new WText(this);
21  w->setTextFormat(PlainText);
22  w->setText(msg);
23  w->setInline(false);
24
25    /*
26   * Little javascript trick to make sure we scroll along with new content
27   */
28  wApp->doJavaScript(this->jsRef() + ".scrollTop += "
29                    + this->jsRef() + ".scrollHeight;");
30 
31}
32
Note: See TracBrowser for help on using the repository browser.