/* examples/panel/text.c */ #include He_node *princ, *panel, *text; void entree_proc (He_node *hn) { printf ("[enter] : \"%s\"\n", HeGetTextValue (hn)); } void butt_proc (He_node *hn) { char *nom = HeGetButtonLabel (hn); if (!strcmp (nom, "Quit")) HeQuit(0); else printf ("lit valeur : \"%s\"\n", HeGetTextValue (text)); } int main (int argc, char *argv[]) { HeInit (&argc, &argv); princ = HeCreateFrame (); HeSetFrameLabel (princ, "Champ de saisie"); panel = HeCreatePanel (princ); HeCreateMessageP (panel, "Texte:", TRUE); text = HeCreateText (panel); HeSetTextVisibleLen (text, 20); HeSetTextNotifyProc (text, entree_proc); HeCreateButtonP (panel, "lit valeur", butt_proc, NULL); HeCreateButtonP (panel, "Quit", butt_proc, NULL); HeFit(panel); HeFit(princ); return HeMainLoop (princ); }