Greyscale bars/Display: Difference between revisions
Content added Content deleted
Thundergnat (talk | contribs) (Rename Perl 6 -> Raku, alphabetize, minor clean-up) |
|||
Line 1,181: | Line 1,181: | ||
=={{header|Phix}}== |
=={{header|Phix}}== |
||
Resizeable. Use of nx avoids rounding/misalignment errors |
Resizeable. Use of nx avoids rounding/misalignment errors |
||
{{libheader|pGUI}} |
{{libheader|Phix/pGUI}} |
||
<lang Phix>-- |
<lang Phix>-- demo\rosetta\Greyscale_bars.exw |
||
-- demo\rosetta\Greyscale_bars.exw |
|||
-- |
|||
include pGUI.e |
include pGUI.e |
||
Line 1,220: | Line 1,218: | ||
cdKillCanvas(cdcanvas) |
cdKillCanvas(cdcanvas) |
||
return IUP_DEFAULT |
return IUP_DEFAULT |
||
end function |
|||
function esc_close(Ihandle /*ih*/, atom c) |
|||
if c=K_ESC then return IUP_CLOSE end if |
|||
return IUP_CONTINUE |
|||
end function |
end function |
||
Line 1,239: | Line 1,232: | ||
IupSetAttribute(dlg, "TITLE", "Greyscale bars") |
IupSetAttribute(dlg, "TITLE", "Greyscale bars") |
||
IupSetCallback(canvas, "ACTION", Icallback("redraw_cb")) |
IupSetCallback(canvas, "ACTION", Icallback("redraw_cb")) |
||
IupCloseOnEscape(dlg) |
|||
IupSetCallback(dlg, "K_ANY", Icallback("esc_close")) |
|||
IupMap(dlg) |
IupMap(dlg) |