/* Edouard.Thiel@lif.univ-mrs.fr */ #include He_node *princ, *panel, *text; void butt_proc (He_node *hn) { char *name = HeGetButtonLabel (hn); if (strcmp (name, "Quit") == 0) { HeQuit(0); } else if (strcmp (name, "Show") == 0) { int id = strtol (HeGetTextValue(text), NULL, 16); XMapRaised (he_display, (Window) id); } else if (strcmp (name, "Hide") == 0) { int id = strtol (HeGetTextValue(text), NULL, 16); XUnmapWindow (he_display, (Window) id); } } int main (int argc, char *argv[]) { HeInit (&argc, &argv); princ = HeCreateFrame(); HeSetFrameLabel (princ, "Hide"); panel = HeCreatePanel (princ); HeCreateMessageP (panel, "Window id:", TRUE); text = HeCreateText (panel); HeSetTextVisibleLen (text, 12); HeSetTip (text, "Tapez \"xwininfo\", puis cliquez sur une\n" "fenêtre pour connaître son \"Window id\".\n" "Recopiez-le dans ce champ de saisie\n" "puis cliquez sur Hide ou Show."); HeCreateButtonP (panel, "Hide", butt_proc, NULL); HeCreateButtonP (panel, "Show", butt_proc, NULL); HeCreateButtonP (panel, "Quit", butt_proc, NULL); HeFit(panel); HeFit (princ); return HeMainLoop (princ); }