Enhanced GEM and popup menu

GFA, ASM, STOS, ...

Moderators: simonsunnyboy, Mug UK, Zorro 2, Moderator Team

Post Reply
User avatar
Arne
Atari Super Hero
Atari Super Hero
Posts: 648
Joined: Thu Nov 01, 2007 10:01 am

Enhanced GEM and popup menu

Post by Arne »

I have almost completed my GEM application just one more thing to do.
I'm using EnhancedGEM Lib 2.20 and Pure C 1.1. I have included a popup via cycle button selection.
This is a screenshot of an EGEM demo application:

Image

When I select an item of the popup menu itself (via clicking on the popup button itself) then my callback functions gets called and I can perform the required action (nothing to do with GEM at all).
But when I press the cycle button the selected item in the "popup button" area changes as expected but my callback isn't called. Any chance to change that?

thanks, Arne
Image
User avatar
Arne
Atari Super Hero
Atari Super Hero
Posts: 648
Joined: Thu Nov 01, 2007 10:01 am

Re: Enhanced GEM and popup menu

Post by Arne »

Seems I got it. I had to install an event handler to react to the cycle button event.

Code: Select all

Event_Handler(EventInit, EventHandler);

Code: Select all

static int EventInit(XEVENT* inCycleButtonEvent, int inEventMask)
{
	(void) inEventMask;
	inCycleButtonEvent->ev_mflags = MU_MESAG;
	return MU_MESAG;
}

static int EventHandler(XEVENT* inCycleButtonEvent)
{
	int			myResult = 0;

	if((inCycleButtonEvent->ev_mwich & MU_MESAG) != 0) {
		switch(inCycleButtonEvent->ev_mmgpbuf[0]) {
			case POPUP_CHANGED:
				/* check if inCycleButtonEvent->ev_mmgpbuf[4]/[5] (two 16bit int) point to your XPOPUP struct	*/
				/* if this is the case then the value (as given in the .H file generated by the RCS) is			*/
				/* located in inCycleButtonEvent->ev_mmgpbuf[3]													*/
				}
				break;
			default:
				break;
		}
		myResult = MU_MESAG;
	}
	return myResult;
}
Don't know if this is the way it's meant to be done but it looks promising.
Image
User avatar
charles
10 GOTO 10
10 GOTO 10
Posts: 2711
Joined: Tue Aug 17, 2004 12:11 am
Location: ont. Canada
Contact:

Re: Enhanced GEM and popup menu

Post by charles »

good work !
The radioactive half-life : )
Atari is a lifestyle,not a hobby.
HOLD ON ! ! ! Im printing unreadable characters ...!
Post Reply

Return to “Coding”