我的错误
gridlist.h: In constructor ‘GridList::GridList(WINDOW*, int, int, int, int, int)’:
gridlist.h:11:47: error: no matching function for call to ‘Window::Window()’
gridlist.h:11:47: note: candidates are:
window.h:13:3: note: Window::Window(WINDOW*, int, int, int, int, int)
我的代码
GridList(WINDOW *parent = stdscr, int colors = MAG_WHITE, int height = GRIDLIST_HEIGHT, int width = GRIDLIST_WIDTH, int y = 0, int x = 0)
: Window(parent, colors, height, width, y, x) {
this->m_buttonCount = -1;
m_maxButtonsPerRow = ((GRIDLIST_WIDTH)/(BUTTON_WIDTH+BUTTON_SPACE_BETWEEN));
this->m_buttons = new Button *[50];
refresh();
}
我有点不确定它到底想告诉我什么以及我做错了什么。我将正确的变量类型和正确数量的参数传递给类。但是它说我正在尝试Window::Window()
不带参数调用。提前感谢您的帮助。
Button 类编译得很好,几乎完全一样。
Button(WINDOW *parent = 0, int colors = STD_SCR, int height = BUTTON_WIDTH, int width = BUTTON_HEIGHT, int y = 0, int x = 0)
: Window(parent, colors, height, width, y, x) {
this->refresh();
}