wanting to try a GUI toolkit: needing some advice on which one to choose
Marcone
marcone at email.com
Sat May 29 01:04:02 UTC 2021
On Friday, 28 May 2021 at 17:04:15 UTC, Vinod K Chandran wrote:
> 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.
Win32Api + Metaprogramming?
More information about the Digitalmars-d-learn
mailing list