Closed TimonKapischke closed 5 years ago
Depends on what you mean. Can you give an example? Isn't void(void) for the button function enough? What types of arguments do you expect to pass to it and to return from it?
void test1() { ...} string test2(graph) {...} string test3() {...}
Button b1 = Button("Button1.png", 100, 100, test1); Button b2 = Button("Button2.png", 200, 100, test2); ...
Maybe we need other functions for the buttons. Not only void functions with no arguments. For level loading : loadLevel(graph); window.close(); (this dosent work yet)
We can also give strings back: With a new variable "GUI_state" we dont need the boolean "is_clicked" variable for every button. string GUI_state = {start, help, settings, level_choosing, ingame}
We can use lambda expressions (https://en.cppreference.com/w/cpp/language/lambda):
std::function<void()> func = [graph] () { do something with graph }
They can capture objects or refs to objects ([] brackets) while the function itself has no arguments.
The create_level() function don't work yet. I can call the SequenceSimulation program but the program doesn't return a FASTA file. I don't know why... Mayby the system call.
Why has Button
a create_level
method?
I wouldn't use system. Just include the Sequence Simulation code as usual. Or simply use fasta files produced externally.
Thanks
I have the problem that I don't know how to pass different function typs with one function call. (void, int, ....)