如何在循环中绘制东西(fltk/c )
How to draw things in a loop (FLTK/C++)?
我有一个问题绘制多个行,它仅显示一行我使用
void fl_push_clip(int x, int y, int w, int h);
,但似乎没有任何作用
我尝试这样的事情
for (int i = 1; i < 10; i++) {
int x = 10 * i, y = 10 * i;
int w = 70 * i, h = 70 * i;
void fl_push_clip(int x, int y, int w, int h);
cout << "TEST" << endl;
}
我使用COUT查看是否有效
#include <FL/Fl.H>
#include <FL/Fl_Widget.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Input.H>
#include <FL/Fl_Int_Input.H>
#include <FL/Fl_Button.H>
#include <FL/Fl_Color_Chooser.H>
int main(int argc, char ** argv)
{
int width = 90, height = 80;
int rowmax = 4, colmax = 7;
window = new Fl_Window(colmax * width + 20, rowmax * height + 240);
window->color(FL_DARK_GREEN);
Fl_Int_Input input = new Fl_Int_Input(140, rowmax * height + 20, colmax * width - 160, 20, "test1");
input->labelfont(FL_BOLD + FL_ITALIC);
for (int i = 1; i < 10; i++) {
int x = 10 * i, y = 10 * i;
int w = 70 * i, h = 70 * i;
void fl_push_clip(int x, int y, int w, int h);
cout << "TEST" << endl;
}
window->end();
window->show(argc, argv);
return Fl::run();
}
我希望看到for是否有助于绘制多个形状或找到相同的替代方案
此处的代码是一个声明:它根本不调用代码
for (int i = 1; i < 10; i++) {
int x = 10 * i, y = 10 * i;
int w = 70 * i, h = 70 * i;
void fl_push_clip(int x, int y, int w, int h); // This is a declaration
cout << "TEST" << endl;
}
如果您想调用常规使用
for (int i = 1; i < 10; i++) {
int x = 10 * i, y = 10 * i;
int w = 70 * i, h = 70 * i;
fl_push_clip(x, y, w, h); // This is a call
cout << "TEST" << endl;
}
您是否在某处定义了std名称空间?
相关文章:
- 如何循环打印顶点结构
- 如何在C++中从两个单独的for循环中添加两个数组
- C++我的数学有什么问题,为什么我的代码不能正确循环
- 正在尝试了解输入验证循环
- std::map<struct,struct>::find 找不到匹配项,但是如果我循环通过 begin() 到 end(),我在那里看到匹配项
- 循环后如何继续阅读
- Ardunio UNO解决了多个重叠的定时器循环
- Eigen如何在容器循环中干净地附加矩阵
- 在某些循环内使用vector.push_back时出现分段错误
- 我正在使用嵌套的while循环来解析具有多行的文本文件,但由于某种原因,它只通过第一行,我不知道为什么
- 为什么我的for循环不能正确获取argv
- 如何声明特征矩阵,然后通过嵌套循环初始化它
- while循环中while循环的时间复杂度是多少
- C++中的高效循环缓冲区,它将被传递给C样式数组函数参数
- 为什么在这个代码结束循环中没有得到结束
- 在基于范围的for循环中使用结构化绑定声明
- 用于C++中带有数组和指针的循环
- 循环中的随机函数
- 是什么阻止DOMTimerCoordinator::NextID进入无休止的循环
- 如何在循环中绘制东西(fltk/c )