⚲
Project
General
Profile
Sign in
Register
Home
Projects
Help
Search
:
Wt
All Projects
Wt
Overview
Activity
Roadmap
Issues
Wiki
Forums
Download (838 Bytes)
Bug #649
ยป test133.cc
Koen Deforche
, 12/21/2010 12:32 PM
#include
<Wt/WApplication>
#include
<Wt/WContainerWidget>
#include
<Wt/WImage>
#include
<Wt/WFileResource>
#include
<Wt/WGridLayout>
using
namespace
Wt
;
WApplication
*
createApp
(
const
WEnvironment
&
env
)
{
WApplication
*
app
=
new
WApplication
(
env
);
WGridLayout
*
layout
=
new
WGridLayout
();
app
->
root
()
->
setLayout
(
layout
,
Wt
::
AlignTop
|
Wt
::
AlignLeft
);
int
rows
=
2
;
int
cols
=
2
;
// NOTE: make sure you use an existing PNG instead of "save01.png".
for
(
int
j
=
0
;
j
<
rows
;
++
j
)
{
for
(
int
i
=
0
;
i
<
cols
;
++
i
)
{
WFileResource
*
r
=
new
WFileResource
(
"save01.png"
);
WImage
*
view
=
new
WImage
(
r
,
"Bla"
);
if
(
view
)
{
layout
->
addWidget
(
view
,
j
,
i
,
Wt
::
AlignTop
|
Wt
::
AlignLeft
);
}
}
}
return
app
;
}
int
main
(
int
argc
,
char
**
argv
)
{
return
WRun
(
argc
,
argv
,
createApp
);
}
(1-1/1)
Loading...