On Thursday, 27 May 2021 at 01:17:44 UTC, someone wrote:

I am learning D by writing a Windows only GUI library. It is taking too much time for me since, I am writing some stuff and then happen to learn some new things about it and re-writing it.Anyhow, so far so good. This is the code now.

```d
import winglib ;
import std.stdio : log = writeln;

void main() {   

        auto frm = new Window() ;       
        frm.text = "Learning D By Writing D";

        // C = Control class. Window is derived from Control
        // E = EventArgs.

frm.onMouseHover = (c, e) => log("Mouse is now on ", e.x, ", ", e.y);
        frm.onMouseLeave = (c, e) => log("Mouse leaved from window") ;     
        frm.onKeyDown =  (c, e) => log(e.keyCode, " key is pressed");
        frm.create() ;

        auto btn = new Button(frm) ;
        btn.font.name = "Calibri" ;
        btn.width = 150 ;
        btn.text = "DMD Or LDC" ;
        btn.font.size = 14 ;
        btn.create() ;

        frm.show() ;    
        
}
```
I am slowly adding more features to this. Till now, Window & Button are completed.




Reply via email to