INTRODUCTION TO WEB DEVELOPMENT IN C++ WITH WT 4 - - PowerPoint PPT Presentation
INTRODUCTION TO WEB DEVELOPMENT IN C++ WITH WT 4 - - PowerPoint PPT Presentation
INTRODUCTION TO WEB DEVELOPMENT IN C++ WITH WT 4 https://www.webtoolkit.eu/wt Roel Standaert FOSDEM 2018 CONTENTS What is Wt? A simple Hello world Creating a larger application, with: Templates Style sheets i18n
2 Introduction to web development in C++ with Wt 4
CONTENTS
- What is Wt?
- A simple “Hello world”
- Creating a larger application, with:
– Templates – Style sheets – i18n
- Being lazy effjcient with Bootstrap
- Where to go from here?
3 Introduction to web development in C++ with Wt 4
WHAT IS WT?
- A server side web framework written in C++
- Made for single page applications
– REST is possible, API currently verbose – Websites also possible: e.g. webtoolkit.eu
- Inspired by Qt
widget based →
- Abstraction of web technologies, adapts to what’s
- available. No JavaScript required.
4 Introduction to web development in C++ with Wt 4
WHY C++?
“I know we sometimes give C++ a bit of a bad rap for having funny defaults and weird, odd edge cases, but just take a look at JavaScript, really.”
– Matt Godbolt at CppCon 2017, youtu.be/bSkpMdDe4g4?t=2870
5 Introduction to web development in C++ with Wt 4
WHY C++?
- Low level vulnerabilities?
– XSS, CSRF and SQL injection are larger threats – Use best practices and tools (compiler warnings,
Valgrind, asan,...)
- Small footprint: no garbage, no runtime, create small
statically linked binaries
- Familiar to Qt developers
- Ecosystem: Wt for web, any C or C++ library for
everything else
6 Introduction to web development in C++ with Wt 4
WT 4
- Released in September 2017
- C++11: it’s about time
7 Introduction to web development in C++ with Wt 4
HELLO WORLD!
Click "Greet me!" (or press Enter):
8 Introduction to web development in C++ with Wt 4
HELLO WORLD!
# i n c l u d e < W t / W A p p l i c a t i
- n
. h > # i n c l u d e < W t / W S e r v e r . h > i n t m a i n ( i n t a r g c , c h a r * a r g v [ ] ) { r e t u r n W t : : W R u n ( a r g c , a r g v , [ ] ( c
- n
s t W t : : W E n v i r
- n
m e n t & e n v ) { a u t
- a
p p = s t d : : m a k e _ u n i q u e < W t : : W A p p l i c a t i
- n
> ( e n v ) ; / / . . . r e t u r n a p p ; } ) ; }
- WRun
un: creates WServer instance, and accepts connections
9 Introduction to web development in C++ with Wt 4
HELLO WORLD!
# i n c l u d e < W t / W A p p l i c a t i
- n
. h > # i n c l u d e < W t / W S e r v e r . h > i n t m a i n ( i n t a r g c , c h a r * a r g v [ ] ) { r e t u r n W t : : W R u n ( a r g c , a r g v , [ ] ( c
- n
s t W t : : W E n v i r
- n
m e n t & e n v ) { a u t
- a
p p = s t d : : m a k e _ u n i q u e < W t : : W A p p l i c a t i
- n
> ( e n v ) ; / / . . . r e t u r n a p p ; } ) ; }
- WRun
un: creates WServer instance, and accepts connections
- New connection
→ callback is called
10 Introduction to web development in C++ with Wt 4
HELLO WORLD!
# i n c l u d e < W t / W A p p l i c a t i
- n
. h > # i n c l u d e < W t / W S e r v e r . h > i n t m a i n ( i n t a r g c , c h a r * a r g v [ ] ) { r e t u r n W t : : W R u n ( a r g c , a r g v , [ ] ( c
- n
s t W t : : W E n v i r
- n
m e n t & e n v ) { a u t
- a
p p = s t d : : m a k e _ u n i q u e < W t : : W A p p l i c a t i
- n
> ( e n v ) ; / / . . . r e t u r n a p p ; } ) ; }
- WRun
un: creates WServer instance, and accepts connections
- New connection
callback is called →
- WEnv
nviron
- nment
nt describes “environment”, e.g. user agent information
11 Introduction to web development in C++ with Wt 4
HELLO WORLD!
# i n c l u d e < W t / W A p p l i c a t i
- n
. h > # i n c l u d e < W t / W S e r v e r . h > i n t m a i n ( i n t a r g c , c h a r * a r g v [ ] ) { r e t u r n W t : : W R u n ( a r g c , a r g v , [ ] ( c
- n
s t W t : : W E n v i r
- n
m e n t & e n v ) { a u t
- a
p p = s t d : : m a k e _ u n i q u e < W t : : W A p p l i c a t i
- n
> ( e n v ) ; / / . . . r e t u r n a p p ; } ) ; }
- WRun
un: creates WServer instance, and accepts connections
- New connection
callback is called →
- WEnv
nviron
- nment
nt describes “environment”, e.g. user agent information
- Callback returns u
n i q u e _ p t r to WApp Applicat cation
- n.
12 Introduction to web development in C++ with Wt 4
HELLO WORLD!
# i n c l u d e < W t / W A p p l i c a t i
- n
. h > # i n c l u d e < W t / W S e r v e r . h > i n t m a i n ( i n t a r g c , c h a r * a r g v [ ] ) { r e t u r n W t : : W R u n ( a r g c , a r g v , [ ] ( c
- n
s t W t : : W E n v i r
- n
m e n t & e n v ) { a u t
- a
p p = s t d : : m a k e _ u n i q u e < W t : : W A p p l i c a t i
- n
> ( e n v ) ; / / . . . r e t u r n a p p ; } ) ; }
- WRun
un: creates WServer instance, and accepts connections
- New connection
callback is called →
- WEnv
nviron
- nment
nt describes “environment”, e.g. user agent information
- Callback returns u
n i q u e _ p t r to WApp Applicat cation
- n.
→ One instance of WApplication per session
13 Introduction to web development in C++ with Wt 4
HELLO WORLD! (CONTINUED)
a u t
- a
p p = . . . a u t
- r
- t
= a p p
- >
r
- t
( ) ; / / W C
- n
t a i n e r W i d g e t * r
- t
( < d i v > )
14 Introduction to web development in C++ with Wt 4
HELLO WORLD! (CONTINUED)
a u t
- a
p p = . . . a u t
- r
- t
= a p p
- >
r
- t
( ) ; / / a d d a n e w W T e x t ( < s p a n > ) r
- t
- >
a d d W i d g e t ( s t d : : m a k e _ u n i q u e < W t : : W T e x t > ( " Y
- u
r n a m e , p l e a s e ? " ) ) ;
15 Introduction to web development in C++ with Wt 4
HELLO WORLD! (CONTINUED)
a u t
- a
p p = . . . a u t
- r
- t
= a p p
- >
r
- t
( ) ; / / a d d a n e w W T e x t , u s i n g t h e a d d N e w s h
- r
t h a n d r
- t
- >
a d d N e w < W t : : W T e x t > ( " Y
- u
r n a m e , p l e a s e ? " ) ;
16 Introduction to web development in C++ with Wt 4
HELLO WORLD! (CONTINUED)
a u t
- a
p p = . . . a u t
- r
- t
= a p p
- >
r
- t
( ) ; r
- t
- >
a d d N e w < W t : : W T e x t > ( " Y
- u
r n a m e , p l e a s e ? " ) ; / / a d d a W L i n e E d i t ( < i n p u t t y p e = " t e x t " > ) W t : : W L i n e E d i t * e d i t = r
- t
- >
a d d N e w < W t : : W L i n e E d i t > ( ) ;
17 Introduction to web development in C++ with Wt 4
HELLO WORLD! (CONTINUED)
a u t
- a
p p = . . . a u t
- r
- t
= a p p
- >
r
- t
( ) ; r
- t
- >
a d d N e w < W t : : W T e x t > ( " Y
- u
r n a m e , p l e a s e ? " ) ; W t : : W L i n e E d i t * e d i t = r
- t
- >
a d d N e w < W t : : W L i n e E d i t > ( ) ; / / a d d a W P u s h B u t t
- n
( < b u t t
- n
> ) a u t
- b
t n = r
- t
- >
a d d N e w < W t : : W P u s h B u t t
- n
> ( " G r e e t m e ! " ) ;
18 Introduction to web development in C++ with Wt 4
HELLO WORLD! (CONTINUED)
a u t
- a
p p = . . . a u t
- r
- t
= a p p
- >
r
- t
( ) ; r
- t
- >
a d d N e w < W t : : W T e x t > ( " Y
- u
r n a m e , p l e a s e ? " ) ; W t : : W L i n e E d i t * e d i t = r
- t
- >
a d d N e w < W t : : W L i n e E d i t > ( ) ; a u t
- b
t n = r
- t
- >
a d d N e w < W t : : W P u s h B u t t
- n
> ( " G r e e t m e ! " ) ; / / a d d a W B r e a k ( < b r > ) r
- t
- >
a d d N e w < W t : : W B r e a k > ( ) ;
19 Introduction to web development in C++ with Wt 4
HELLO WORLD! (CONTINUED)
a u t
- a
p p = . . . a u t
- r
- t
= a p p
- >
r
- t
( ) ; r
- t
- >
a d d N e w < W t : : W T e x t > ( " Y
- u
r n a m e , p l e a s e ? " ) ; W t : : W L i n e E d i t * e d i t = r
- t
- >
a d d N e w < W t : : W L i n e E d i t > ( ) ; a u t
- b
t n = r
- t
- >
a d d N e w < W t : : W P u s h B u t t
- n
> ( " G r e e t m e ! " ) ; r
- t
- >
a d d N e w < W t : : W B r e a k > ( ) ; / / e m p t y W T e x t i n P l a i n f
- r
m a t ( d e f a u l t i s f i l t e r e d X H T M L ) a u t
- r
e s u l t = r
- t
- >
a d d N e w < W t : : W T e x t > ( ) ; r e s u l t
- >
s e t T e x t F
- r
m a t ( W t : : T e x t F
- r
m a t : : P l a i n ) ;
20 Introduction to web development in C++ with Wt 4
HELLO WORLD! (CONTINUED)
a u t
- a
p p = . . . a u t
- r
- t
= a p p
- >
r
- t
( ) ; r
- t
- >
a d d N e w < W t : : W T e x t > ( " Y
- u
r n a m e , p l e a s e ? " ) ; W t : : W L i n e E d i t * e d i t = r
- t
- >
a d d N e w < W t : : W L i n e E d i t > ( ) ; a u t
- b
t n = r
- t
- >
a d d N e w < W t : : W P u s h B u t t
- n
> ( " G r e e t m e ! " ) ; r
- t
- >
a d d N e w < W t : : W B r e a k > ( ) ; a u t
- r
e s u l t = r
- t
- >
a d d N e w < W t : : W T e x t > ( ) ; r e s u l t
- >
s e t T e x t F
- r
m a t ( W t : : T e x t F
- r
m a t : : P l a i n ) ; / / c r e a t e a l a m b d a f u n c t i
- n
a u t
- s
h
- w
G r e e t i n g = [ e d i t , r e s u l t ] { r e s u l t
- >
s e t T e x t ( W t : : W S t r i n g ( " H e l l
- ,
{ 1 } ! " ) . a r g ( e d i t
- >
t e x t ( ) ) ) ; } ;
21 Introduction to web development in C++ with Wt 4
HELLO WORLD! (CONTINUED)
a u t
- a
p p = . . . a u t
- r
- t
= a p p
- >
r
- t
( ) ; r
- t
- >
a d d N e w < W t : : W T e x t > ( " Y
- u
r n a m e , p l e a s e ? " ) ; W t : : W L i n e E d i t * e d i t = r
- t
- >
a d d N e w < W t : : W L i n e E d i t > ( ) ; a u t
- b
t n = r
- t
- >
a d d N e w < W t : : W P u s h B u t t
- n
> ( " G r e e t m e ! " ) ; r
- t
- >
a d d N e w < W t : : W B r e a k > ( ) ; a u t
- r
e s u l t = r
- t
- >
a d d N e w < W t : : W T e x t > ( ) ; r e s u l t
- >
s e t T e x t F
- r
m a t ( W t : : T e x t F
- r
m a t : : P l a i n ) ; a u t
- s
h
- w
G r e e t i n g = [ e d i t , r e s u l t ] { r e s u l t
- >
s e t T e x t ( W t : : W S t r i n g ( " H e l l
- ,
{ 1 } ! " ) . a r g ( e d i t
- >
t e x t ( ) ) ) ; } ; / / c
- n
n e c t s i g n a l s e d i t
- >
e n t e r P r e s s e d ( ) . c
- n
n e c t ( s h
- w
G r e e t i n g ) ; b t n
- >
c l i c k e d ( ) . c
- n
n e c t ( s h
- w
G r e e t i n g ) ;
22 Introduction to web development in C++ with Wt 4
HELLO WORLD! (FINAL CODE)
23 Introduction to web development in C++ with Wt 4
BUILD AND RUN
Re Releas lease: e:
c + +
- s
t d = c + + 1 4
- O
3
- D
N D E B U G
- h
e l l
- .
w t h e l l
- .
c p p \
- I
/ p a t h / t
- /
w t / i n c l u d e
- L
/ p a t h / t
- /
w t / l i b \
- l
w t
- l
w t h t t p
Debug: g:
c + +
- s
t d = c + + 1 4
- O
- g
3
- h
e l l
- .
w t h e l l
- .
c p p \
- I
/ p a t h / t
- /
w t / i n c l u d e
- L
/ p a t h / t
- /
w t / l i b \
- l
w t d
- l
w t h t t p d
Ru Run:
. / h e l l
- .
w t
- d
- c
r
- t
.
- h
t t p
- l
i s t e n l
- c
a l h
- s
t : 8 8
- -docroot: Where to serve static content from
- -http-listen: host and port to listen on
(0.0.0.0 for any IPv4, [0::0] for any IPv6)
24 Introduction to web development in C++ with Wt 4
DEMO
25 Introduction to web development in C++ with Wt 4
CREATING LARGER WT APPLICATIONS
- Classic: using layouts:
– WBoxLayout, WGridLayout, WBorderLayout
- Using templates:
– HTML and CSS (if CSS isn’t your forte, there’s
Bootstrap)
26 Introduction to web development in C++ with Wt 4
TYPICAL PROJECT STRUCTURE
m y
- w
t
- a
p p / a p p r
- t
/ t e m p l a t e s . x m l s t r i n g s . x m l w t _ c
- n
f i g . x m l d
- c
r
- t
/ s t y l e . c s s s t r i n g s _ n l . x m l
English strings Dutch strings Templates Wt confjguration CSS stylesheet Static web content Confjguration, templates, SQLite database, i18n,...
27 Introduction to web development in C++ with Wt 4
TEMPLATE.XML
< ? x m l v e r s i
- n
= " 1 . " e n c
- d
i n g = " U T F
- 8
" ? > < m e s s a g e s > < m e s s a g e i d = " t p l . t e m p l a t e " > $ { t r : s t r . p r
- m
p t } $ { e d i t } $ { b t n } < b r / > $ { r e s u l t } < / m e s s a g e > < / m e s s a g e s >
$ { v a r i a b l e } $ { f u n c t i
- n
: a r g s }
28 Introduction to web development in C++ with Wt 4
TEMPLATE.XML
< ? x m l v e r s i
- n
= " 1 . " e n c
- d
i n g = " U T F
- 8
" ? > < m e s s a g e s > < m e s s a g e i d = " t p l . t e m p l a t e " > $ { t r : s t r . p r
- m
p t } $ { e d i t } $ { b t n } < b r / > $ { r e s u l t } < / m e s s a g e > < / m e s s a g e s >
$ { v a r i a b l e } $ { f u n c t i
- n
: a r g s }
29 Introduction to web development in C++ with Wt 4
STRINGS.XML
< ? x m l v e r s i
- n
= " 1 . " e n c
- d
i n g = " U T F
- 8
" ? > < m e s s a g e s > < m e s s a g e i d = " s t r . p r
- m
p t " > P l e a s e e n t e r y
- u
r n a m e : < / m e s s a g e > < m e s s a g e i d = " s t r . g r e e t
- m
e " > G r e e t m e < / m e s s a g e > < m e s s a g e i d = " s t r . r e s u l t " > H e l l
- ,
{ 1 } ! < / m e s s a g e > < / m e s s a g e s > < ? x m l v e r s i
- n
= " 1 . " e n c
- d
i n g = " U T F
- 8
" ? > < m e s s a g e s > < m e s s a g e i d = " s t r . p r
- m
p t " > V
- e
r j
- u
w n a a m i n : < / m e s s a g e > < m e s s a g e i d = " s t r . g r e e t
- m
e " > B e g r
- e
t m e < / m e s s a g e > < m e s s a g e i d = " s t r . r e s u l t " > H a l l
- ,
{ 1 } ! < / m e s s a g e > < / m e s s a g e s >
STRINGS_NL.XML
30 Introduction to web development in C++ with Wt 4
STYLE.CSS
b
- d
y { f
- n
t
- f
a m i l y : s a n s
- s
e r i f ; }
31 Introduction to web development in C++ with Wt 4
LOADING TEMPLATES, STRINGS & STYLESHEETS
/ / l
- a
d a p p r
- t
/ t e m p l a t e . x m l a p p
- >
m e s s a g e R e s
- u
r c e B u n d l e ( ) . u s e ( a p p
- >
a p p R
- t
( ) + " t e m p l a t e " ) ; / / l
- a
d a p p r
- t
/ s t r i n g s . x m l / / (
- r
a p p r
- t
/ s t r i n g s _ n l . x m l ) a p p
- >
m e s s a g e R e s
- u
r c e B u n d l e ( ) . u s e ( a p p
- >
a p p R
- t
( ) + " s t r i n g s " ) ; / / a d d s t y l e s h e e t a p p
- >
u s e S t y l e S h e e t ( " s t y l e . c s s " ) ;
32 Introduction to web development in C++ with Wt 4
HELLOTEMPLATE
c l a s s H e l l
- T
e m p l a t e : p u b l i c W t : : W T e m p l a t e { p u b l i c : H e l l
- T
e m p l a t e ( ) ; } ;
33 Introduction to web development in C++ with Wt 4
HELLOTEMPLATE (CONTINUED)
H e l l
- T
e m p l a t e : : H e l l
- T
e m p l a t e ( ) : W T e m p l a t e { t r ( " t p l . t e m p l a t e " ) } { a d d F u n c t i
- n
( " t r " , & W T e m p l a t e : : F u n c t i
- n
s : : t r ) ; a u t
- e
d i t = b i n d W i d g e t ( " e d i t " , s t d : : m a k e _ u n i q u e < W t : : W L i n e E d i t > ( ) ) ; a u t
- b
t n = b i n d N e w < W t : : W P u s h B u t t
- n
> ( " b t n " , t r ( " s t r . g r e e t
- m
e " ) ) ; b i n d E m p t y ( " r e s u l t " ) ; a u t
- s
h
- w
G r e e t i n g = [ t h i s ] { a u t
- e
d i t = r e s
- l
v e < W t : : W L i n e E d i t * > ( " e d i t " ) ; b i n d S t r i n g ( " r e s u l t " , t r ( " s t r . r e s u l t " ) . a r g ( e d i t
- >
t e x t ( ) ) , W t : : T e x t F
- r
m a t : : P l a i n ) ; } ; e d i t
- >
e n t e r P r e s s e d ( ) . c
- n
n e c t ( s h
- w
G r e e t i n g ) ; b t n
- >
c l i c k e d ( ) . c
- n
n e c t ( s h
- w
G r e e t i n g ) ; }
34 Introduction to web development in C++ with Wt 4
NEW MAIN
35 Introduction to web development in C++ with Wt 4
BUILD AND RUN
Re Releas lease: e:
c + +
- s
t d = c + + 1 4
- O
3
- D
N D E B U G
- t
e m p l a t e . w t t e m p l a t e . c p p \
- I
/ p a t h / t
- /
w t / i n c l u d e
- L
/ p a t h / t
- /
w t / l i b \
- l
w t
- l
w t h t t p
Debug: g:
c + +
- s
t d = c + + 1 4
- O
- g
3
- t
e m p l a t e . w t t e m p l a t e . c p p \
- I
/ p a t h / t
- /
w t / i n c l u d e
- L
/ p a t h / t
- /
w t / l i b \
- l
w t d
- l
w t h t t p d
Ru Run:
. / t e m p l a t e . w t
- a
p p r
- t
a p p r
- t
- d
- c
r
- t
d
- c
r
- t
\
- h
t t p
- l
i s t e n l
- c
a l h
- s
t : 8 8
36 Introduction to web development in C++ with Wt 4
DEMO
37 Introduction to web development in C++ with Wt 4
USING BOOTSTRAP: BEING LAZY EFFICIENT
a u t
- t
h e m e = s t d : : m a k e _ s h a r e d < W t : : W B
- t
s t r a p T h e m e > ( ) ; t h e m e
- >
s e t V e r s i
- n
( W t : : B
- t
s t r a p V e r s i
- n
: : v 3 ) ; a p p
- >
s e t T h e m e ( t h e m e ) ;
- Includes Bootstrap CSS
- Adds appropriate classes
- Wt’s own widgets in Bootstrap style
38 Introduction to web development in C++ with Wt 4
TEMPLATE.XML: FORM
< d i v c l a s s = " f
- r
m
- h
- r
i z
- n
t a l " > < d i v c l a s s = " f
- r
m
- g
r
- u
p " > < l a b e l c l a s s = " c
- l
- m
d
- 3
c
- n
t r
- l
- l
a b e l " f
- r
= " $ { i d : e d i t } " > $ { t r : s t r . p r
- m
p t } < / l a b e l > < d i v c l a s s = " c
- l
- m
d
- 6
" > $ { e d i t } < / d i v > < / d i v > < d i v c l a s s = " f
- r
m
- g
r
- u
p " > < d i v c l a s s = " c
- l
- m
d
- f
f s e t
- 3
c
- l
- m
d
- 6
" > $ { b t n c l a s s = " b t n
- p
r i m a r y " } < / d i v > < / d i v > < / d i v >
39 Introduction to web development in C++ with Wt 4
TEMPLATE.XML: RESULT
$ { < i f
- r
e s u l t > } < d i v c l a s s = " r
- w
" > < d i v c l a s s = " a l e r t a l e r t
- i
n f
- t
e x t
- c
e n t e r c
- l
- m
d
- f
f s e t
- 1
c
- l
- m
d
- 8
" > $ { r e s u l t } < / d i v > < / d i v > $ { < / i f
- r
e s u l t > }
$ { < c
- n
d i t i
- n
> } $ { < / c
- n
d i t i
- n
> }
40 Introduction to web development in C++ with Wt 4
HELLOTEMPLATE (CONTINUED)
H e l l
- T
e m p l a t e : : H e l l
- T
e m p l a t e ( ) : W T e m p l a t e { t r ( " t p l . t e m p l a t e " ) } { a d d F u n c t i
- n
( " i d " , & W T e m p l a t e : : F u n c t i
- n
s : : i d ) ; a d d F u n c t i
- n
( " t r " , & W T e m p l a t e : : F u n c t i
- n
s : : t r ) ; a u t
- e
d i t = b i n d W i d g e t ( " e d i t " , s t d : : m a k e _ u n i q u e < W t : : W L i n e E d i t > ( ) ) ; a u t
- b
t n = b i n d N e w < W t : : W P u s h B u t t
- n
> ( " b t n " , t r ( " s t r . g r e e t
- m
e " ) ) ; b i n d E m p t y ( " r e s u l t " ) ; a u t
- s
h
- w
G r e e t i n g = [ t h i s ] { a u t
- e
d i t = r e s
- l
v e < W t : : W L i n e E d i t * > ( " e d i t " ) ; s e t C
- n
d i t i
- n
( " i f
- r
e s u l t " , t r u e ) ; b i n d S t r i n g ( " r e s u l t " , t r ( " s t r . r e s u l t " ) . a r g ( e d i t
- >
t e x t ( ) ) , W t : : T e x t F
- r
m a t : : P l a i n ) ; } ; e d i t
- >
e n t e r P r e s s e d ( ) . c
- n
n e c t ( s h
- w
G r e e t i n g ) ; b t n
- >
c l i c k e d ( ) . c
- n
n e c t ( s h
- w
G r e e t i n g ) ; }
41 Introduction to web development in C++ with Wt 4
BUILD AND RUN
Re Releas lease: e:
c + +
- s
t d = c + + 1 4
- O
3
- D
N D E B U G
- b
- t
s t r a p . w t b
- t
s t r a p . c p p \
- I
/ p a t h / t
- /
w t / i n c l u d e
- L
/ p a t h / t
- /
w t / l i b \
- l
w t
- l
w t h t t p
Debug: g:
c + +
- s
t d = c + + 1 4
- O
- g
3
- b
- t
s t r a p . w t b
- t
s t r a p . c p p \
- I
/ p a t h / t
- /
w t / i n c l u d e
- L
/ p a t h / t
- /
w t / l i b \
- l
w t d
- l
w t h t t p d
Ru Run:
. / b
- t
s t r a p . w t
- a
p p r
- t
a p p r
- t
- d
- c
r
- t
d
- c
r
- t
\
- h
t t p
- l
i s t e n l
- c
a l h
- s
t : 8 8 \
- r
e s
- u
r c e s
- d
i r = / p a t h / t
- /
w t / s h a r e / W t / r e s
- u
r c e s
42 Introduction to web development in C++ with Wt 4
DEMO
43 Introduction to web development in C++ with Wt 4
WHERE TO GO FROM HERE?
- Tutorials: https://webtoolkit.eu/wt/documentation
–
A hands-on introduction to Wt
–
A hands-on introduction to Wt::Dbo
–
Introduction to Wt::Auth
–
Library overview
- Widget gallery: https://webtoolkit.eu/widgets
- GitHub: https://github.com/emweb/wt
- Examples: examples directory in Wt source tree
44 Introduction to web development in C++ with Wt 4