Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!mit-eddie!uw-beaver!rice!sun-spots-request From: STRIANTAFYLL%KOSDS1@gmr.com (S. Triantafyllopoulos) Newsgroups: comp.sys.sun Subject: help needed with Sunview Application Keywords: Windows Message-ID: <3756@kalliope.rice.edu> Date: 30 May 89 14:19:00 GMT Sender: usenet@rice.edu Organization: Sun-Spots Lines: 63 Approved: Sun-Spots@rice.edu X-Sun-Spots-Digest: Volume 8, Issue 22, message 8 of 10 I need some help in doing a relatively (:-)) simple thing on SunView. (The machine is a Sun 386i / 250, running SunOS, release 4.0.1) I have an application that uses a two-level button menu, like this: Entry Panel -- This is the Panel after user selects EDIT initial panel when program first from Entry Panel. A-F are the runs. EDIT produces panel shown editing options, RETURN returns right, QUIT confirms and quits. to Entry Panel. +-------------------------------+ +------------------------------+ +-------------------------------+ +------------------------------+ | _________ __________ | | ___ ___ ___ ___ | | ( EDIT ) ( QUIT ) | | ( A ) ( B ) ( C ) ( D ) | | --------- ---------- | | --- --- --- --- | | | | ___ ___ __________ | | | | ( E ) ( F ) ( RETURN ) | | | | --- --- ---------- | +-------------------------------+ +------------------------------+ I create the frame as usual, then a panel on top of that as usual, then define the entry panel buttons, then go into window_main_loop(); init_entry_menu_buttons() sets up the two buttons, EDIT & QUIT. In the entry_menu_button_handler, when EDIT is signalled, I call a routine to destroy the entry_menu_buttons using the SUNVIEW routine destroy_panel_item(button...). Then, it calls a routine init_edit_menu_buttons that initializes the edit buttons A-F & RETURN. ----------- PROBLEM ------------------------------------------------ The problem seems to be the following: When I try to destroy all the items of the entry panel (EDIT & QUIT) so that the edit buttons can be displayed, the button that was pressed to bring the edit buttons (EDIT) STAYS there after I release the mouse. The image of the EDIT button stays on the screen but is not selectable. Moreover, this ghost image seems to screw up the edit mode buttons as well. I think that the image is created and is non-selectable because of the re-painting that is done after I return from the button handler. I.e. when the button EDIT is pressed, everything is deleted and the new buttons are painted, but when control returns, the EDIT image is somehow restored (it was ``blackened'' when pressed). I have tried quite a few things and do not seem to be able to get anywhere. Do I have to do some more magic to delete buttons; according to the FM delete_panel_item's about all it is to delete items. Do I have to write my own event handler? Manipulate the event queue? ?????? Your help on the subject will be appreciated. Please send e-mail to any of the addresses below. Thank you in advance! Spiros Spiros Triantafyllopoulos spiros@gmr.com Delco Electronics, Kokomo, Indiana spiros%gmr.com@relay.cs.net (317) 451-0641 striantafyll%kosds1.gm@hac2arpa.hac.com