mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-07 20:17:37 +00:00
41 lines
1.1 KiB
C
41 lines
1.1 KiB
C
/* HelloWorld.c: Simple demo program for "pagelets" */
|
|
|
|
#include <stdio.h>
|
|
|
|
int main(void)
|
|
{
|
|
char ch;
|
|
printf("\033{S\007"); /* XMLTerm escape sequence signalling start of HTML */
|
|
|
|
printf("<FORM> \
|
|
<IMG align=center src='chrome://navigator/skin/animthrob_single.gif'> \
|
|
<B>Please click a button</B> <BR> \
|
|
<INPUT ID='button-b#' TYPE=button VALUE='Bold' \
|
|
onClick=\"return clickXMLTerm('sendln','#','b')\"> \
|
|
<INPUT ID='button-e#' TYPE=button VALUE='Emphasis' \
|
|
onClick=\"return clickXMLTerm('sendln',#,'e')\"> \
|
|
<INPUT ID='button-q#' TYPE=button VALUE='Quit' \
|
|
onClick=\"return clickXMLTerm('sendln',#,'q')\"> \
|
|
<BR></FORM>");
|
|
|
|
printf("%c", '\0'); /* XMLTerm escape sequence signalling end of HTML */
|
|
|
|
while((ch = getchar())){ /* Poll for data generated by button click events */
|
|
switch (ch) {
|
|
case 'b':
|
|
printf("\033{S\007<B>Hello World!</B><BR> %c", '\0');
|
|
break;
|
|
case 'e':
|
|
printf("\033{S\007<EM>Hello World!</EM><BR> %c", '\0');
|
|
break;
|
|
case 'q':
|
|
return 0;
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
|
|
return 0;
|
|
}
|