Passing a function as an argument to another function : what is this sorcery ?

2014-05-25 Thread Derix via Digitalmars-d-learn
Hello everyone, So I'm Getting Started With Gtkd [1] and the tuto includes this piece of code : ... DrawingArea da = new DrawingArea(590, 200); da.addOnDraw(onDraw); layout.put(da, 5, 30); add(layout); // Add the layout to our main window showAll(); }

Re: Passing a function as an argument to another function : what is this sorcery ?

2014-05-25 Thread Ali Çehreli via Digitalmars-d-learn
On 05/25/2014 02:37 AM, Derix wrote: DrawingArea da = new DrawingArea(590, 200); da.addOnDraw(onDraw); layout.put(da, 5, 30); add(layout); // Add the layout to our main window showAll(); } bool onDraw(Context c, Widget w) {

Re: Passing a function as an argument to another function : what is this sorcery ?

2014-05-25 Thread Rikki Cattermole via Digitalmars-d-learn
On 25/05/2014 9:37 p.m., Derix wrote: Hello everyone, So I'm Getting Started With Gtkd [1] and the tuto includes this piece of code : ... DrawingArea da = new DrawingArea(590, 200); da.addOnDraw(onDraw); layout.put(da, 5, 30); add(layout); // Add the layout

Re: Passing a function as an argument to another function : what is this sorcery ?

2014-05-25 Thread Gary Willoughby via Digitalmars-d-learn
On Sunday, 25 May 2014 at 09:37:46 UTC, Derix wrote: Hello everyone, So I'm Getting Started With Gtkd [1] and the tuto includes this piece of code : ... DrawingArea da = new DrawingArea(590, 200); da.addOnDraw(onDraw); layout.put(da, 5, 30); add(layout); // Add