Simple windowed application/Arwen: Difference between revisions

From Rosetta Code
Content added Content deleted
(Phix/arwen sub-page created)
 
m (above -> pGUI)
 
Line 1: Line 1:
On request, I have restored the following Phix/arwen version (win32-only).<br>
On request, I have restored the following Phix/arwen version (win32-only).<br>
The included demo\edita contains a window painter that lets you reposition/resize this very easily (alas the equivalent for the above is progressing rather leisurely).
The included demo\edita contains a window painter that lets you reposition/resize this very easily (alas the equivalent for pGUI is progressing rather leisurely).
<!--<lang Phix>-->
<!--<lang Phix>-->
<span style="color: #008080;">include</span> <span style="color: #000000;">arwen</span><span style="color: #0000FF;">.</span><span style="color: #000000;">ew</span>
<span style="color: #008080;">include</span> <span style="color: #000000;">arwen</span><span style="color: #0000FF;">.</span><span style="color: #000000;">ew</span>

Latest revision as of 11:53, 10 January 2022

On request, I have restored the following Phix/arwen version (win32-only).
The included demo\edita contains a window painter that lets you reposition/resize this very easily (alas the equivalent for pGUI is progressing rather leisurely).

include arwen.ew 
 
constant main  = create(Window,"Simple windowed application",0,0,100,100,300,200, 0)
constant label = create(Label, "There have been no clicks yet",0,main,10,10,250,30,0)
constant btn   = create(Button,"Click me",0,main,100,50,100,30,0)
integer count = 0
 
function mainHandler(integer id, integer msg, atom /*wParam*/, object /*lParam*/)
    if id=btn and msg=WM_COMMAND then
        count += 1
        setText(label,sprintf("clicked %d times",count))
    end if
    return 0
end function
setHandler(btn,routine_id("mainHandler"))
 
WinMain(main,SW_NORMAL)