Koen Deforche c702bb008b Several changes: 9 år sedan
..
icons c70f73a287 see Changelog 14 år sedan
sounds c96f650dba prepping 2.99.5 15 år sedan
CMakeLists.txt c70f73a287 see Changelog 14 år sedan
PopupChatWidget.C 25bc507f5e implemented WTreeView/WTableView events outside items 12 år sedan
PopupChatWidget.h c680a57226 improvements to chatwidget, documentation updates 13 år sedan
README.md 8455fb6ae2 added README.md files for examples, several bug fixes 13 år sedan
SimpleChatServer.C f2a7d4ebb3 fix chat formatting bug, WAxis.C issue with singular date(time) 13 år sedan
SimpleChatServer.h f2a7d4ebb3 fix chat formatting bug, WAxis.C issue with singular date(time) 13 år sedan
SimpleChatWidget.C c702bb008b Several changes: 9 år sedan
SimpleChatWidget.h 1aca2f1d32 Several changes: 10 år sedan
chatapp.css c70f73a287 see Changelog 14 år sedan
chatwidget.css eedfab588f widget gallery and homepage updates 11 år sedan
chatwidget_ie6.css 8ff5005fde see Changelog 14 år sedan
simpleChat.C 8eef8af388 Several changes: 10 år sedan
simplechat.xml eedfab588f widget gallery and homepage updates 11 år sedan
simplechat_ru.xml 41541a3b9c remove openssl requirement for md5 14 år sedan

README.md

Simplechat example

The simplechat example is a simple multi-user client + server. It is simple in many ways, including the constraint that all sessions run in the same process (it does not use inter-process communication), and that the client does not have any advanced functions.

The example can be run as a plain Wt application, but also as a widget set widget, which is a popup chat box that sits in the bottom right of the browser window, and can be integrated easily in another website. See the blog post for more information.

How to run

See the README in the parent directory.

What it illustrates

  • how to use server push, and post events to sessions using WServer::post() how to reuse a single widget to have two different
  • UI experiences (as a normal widget, or as a compact real-estate conserving widget for the chat popup)
  • how Wt supports Cross-Origin requests to implement widget set mode
  • the use of layout managers (WVBoxLayout and WHBoxLayout)
  • how to play small UI sounds using WSound
  • how to connect client-side JavaScript to a signal, to react to certain events
  • how to implement a method in client-side JavaScript using implementJavaScript()
  • how to safely render user-entered HTML without risking XSS