本文整理汇总了C++中DataSource::GetValues方法的典型用法代码示例。如果您正苦于以下问题:C++ DataSource::GetValues方法的具体用法?C++ DataSource::GetValues怎么用?C++ DataSource::GetValues使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataSource
的用法示例。
在下文中一共展示了DataSource::GetValues方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main()
{
std::cout << "Hello, world!" << std::endl;
DataSource *src = new DataSource();
std::cout << src->GetValues()[0] << std::endl;
return 1;
// Open a display.
Display *d = XOpenDisplay(0);
if ( d )
{
// Create the window
Window w = XCreateWindow(
d, // Display
DefaultRootWindow(d), // Parent
0, 0, // x, y
200, 600, // width, height
0, // border width
CopyFromParent, // depth
CopyFromParent, // class
CopyFromParent, // visual
0, // valuemask
0 // attributes
);
// Show the window
XMapWindow(d, w);
XFlush(d);
// Test Widget
cairo_surface_t *cs = cairo_xlib_surface_create(
d, // X11 display
w, // Drawable surface, in this case the window
DefaultVisual(d, 0),
200,
600
);
cairo_t *cr = cairo_create(cs);
XSelectInput(d, w, ExposureMask);
// ---------------------------------------------------------
// Setup Widget
VertLayoutWidget *wid = new VertLayoutWidget();
wid->set_size(new Size(0, 0, 200, 600));
wid->set_margin(new Box(10));
wid->set_padding(new Box(8));
wid->set_spacing(8);
wid->HonorChildSizes = true; // start simple
// Add a child
Widget *chld = new Widget();
chld->set_background_color(new Color(1, 0, 0, 1));
chld->set_border_color(new Color(0, 1, 0, 1));
chld->set_margin(new Box(0));
chld->set_requested_size(new Size(-1, -1, -1, -1));
// 1st Child
wid->add_child(chld);
// 2nd
wid->add_child(new Widget(*chld));
// 3rd
wid->add_child(new Widget(*chld));
//chld->set_requested_size(new Size(-1, -1, 500, 100));
wid->Draw(cr);
// ----------------------------------------------------------
XEvent ev;
while (1) {
XNextEvent(d, &ev);
std::cout << "Event!" << std::endl;
if (ev.type == Expose) {
wid->Draw(cr);
}
}
cairo_destroy(cr);
cairo_surface_destroy(cs);
XCloseDisplay(d);
return 0;
}
}