Determine if only one instance is running: Difference between revisions
Content added Content deleted
Thundergnat (talk | contribs) (Rename Perl 6 -> Raku, alphabetize, minor clean-up) |
|||
Line 923: | Line 923: | ||
=={{header|Phix}}== |
=={{header|Phix}}== |
||
{{libheader|pGUI}} |
{{libheader|Phix/pGUI}} |
||
<lang Phix>-- |
<lang Phix>-- demo\rosetta\Single_instance.exw |
||
-- demo\rosetta\Single_instance.exw |
|||
-- |
|||
include pGUI.e |
include pGUI.e |
||
Line 933: | Line 931: | ||
printf(1,"COPYDATA(%s, %d)\n",{peek_string(pCommandLine), size}); |
printf(1,"COPYDATA(%s, %d)\n",{peek_string(pCommandLine), size}); |
||
return IUP_DEFAULT; |
return IUP_DEFAULT; |
||
end function |
|||
function esc_close(Ihandle /*ih*/, atom c) |
|||
return iff(c=K_ESC?IUP_CLOSE:IUP_CONTINUE) |
|||
end function |
end function |
||
Line 944: | Line 938: | ||
Ihandle dlg = IupDialog(IupVbox({IupLabel("hello")},"MARGIN=200x200")) |
Ihandle dlg = IupDialog(IupVbox({IupLabel("hello")},"MARGIN=200x200")) |
||
IupSetAttribute(dlg,"TITLE","Single Instance") |
IupSetAttribute(dlg,"TITLE","Single Instance") |
||
IupCloseOnEscape(dlg) |
|||
IupSetCallback(dlg, "K_ANY", Icallback("esc_close")) |
|||
IupSetCallback(dlg, "COPYDATA_CB", Icallback("copydata_cb")); |
IupSetCallback(dlg, "COPYDATA_CB", Icallback("copydata_cb")); |
||
IupShow(dlg) |
IupShow(dlg) |