]> git.tdb.fi Git - libs/gui.git/blobdiff - source/window.cpp
core/error.h renamed to except.h
[libs/gui.git] / source / window.cpp
index 5395a00535c3aa2c4ee41797b0d71b6513aaacf1..fb8ea332ad4346aad712aee34ad0e1eb2a8ceed9 100644 (file)
@@ -6,8 +6,9 @@ Distributed under the LGPL
 */
 
 #include <vector>
+#include <X11/Xatom.h>
 #include <X11/Xutil.h>
-#include <msp/core/error.h>
+#include <msp/core/except.h>
 #include "window.h"
 
 using namespace std;
@@ -52,6 +53,17 @@ Window::~Window()
                XCloseDisplay(display);
 }
 
+void Window::set_title(const string &title)
+{
+       vector<unsigned char> buf(title.begin(), title.end());
+       XTextProperty prop;
+       prop.value=&buf[0];
+       prop.encoding=XA_STRING;
+       prop.format=8;
+       prop.nitems=title.size();
+       XSetWMName(display, window, &prop);
+}
+
 void Window::show()
 {
        XMapRaised(display, window);