Q: About popups & cascade menus

Worawut Wisutmethangoon (wisutmet@cae.wisc.edu)
Mon, 23 Dec 1996 12:46:05 -0600

To subscribers of the xforms list from Worawut Wisutmethangoon <wisutmet@cae.wisc.edu> :

Hello,

I have a problem which I hope someone can answer.

The example program "pup" in DEMOS directory gives the following
error when the button "menu" is pushed.

X Error of failed request: BadMatch (invalid parameter attributes)
Major opcode of failed request: 1 (X_CreateWindow)
Serial number of failed request: 447
Current serial number in output stream: 455

This happens on only HP machines at school but the program works
fine under linux at home. Also if the program is run on HP but use
the linux as the display, it works.

I have found that the culprit is in function "init_menu" in the line

mm=fl_newpup(0);

The argument is supposed to be ID of the window to which the popup
belongs. I don't know why 0 is used here and why sometimes it works
but sometimes it doesn't.

I try to write a program which has cascade menus and want to follow
the example. I know that there are other ways to do it, such as define
popups after the form is shown (as in function do_pup in the same file),
or use callbacks. However, I don't like using callbacks because it does
not give the same sense as normal menu. The menu will pop up only after
you push and release the mouse button.

Is there any way to make the method in the demo program pup works?
I hope you all understand what I explained and thank you in advance
for any suggestions.

Regards,
Worawut W.

PS: This is version 0.81 of XForms. I've never tried the newer release
yet.