On 27-Feb-01 at 15:38, Gerd Moellmann ([EMAIL PROTECTED]) wrote:
> Rick Scott <[EMAIL PROTECTED]> writes:
> 
> > Next is this little gem.....
> > 
> >   /* tricky way to know if this RowColumn is a menubar or a pulldown...
> >   */ menubar_p = False;
> >   XtSetArg (al[0], XmNisHomogeneous, &menubar_p);
> >   XtGetValues (widget, al, 1);
> > 
> > What is the need to "trick" the RowColumn when you could ask it nicely,
> > ie XmNrowColumnType?????
> 
> I don't know how this code came in, but in 21's sources, with the help
> of a kind LessTif hacker, I've changed it to 
> 
>  /* WIDGET should be a RowColumn.  */
>   if (!XmIsRowColumn (widget))
>     abort ();
> 
>   /* Determine whether WIDGET is a menu bar.  */
>   type = -1;
>   XtSetArg (al[0], XmNrowColumnType, &type);
>   XtGetValues (widget, al, 1);
>   if (type != XmMENU_BAR && type != XmMENU_PULLDOWN && type !=
>   XmMENU_POPUP)   abort ();
>   menubar_p = type == XmMENU_BAR;
> 
> which worked both with Motif and LessTif.

I looked at the 21 sources for this and there is a couple of comparisons
between a widget and None. While this may work, it is not exactly correct, and
may show up as 64 bit problems. A Widget should be compared to NULL, None is
for Windows, or Pixmaps, or Resources, can't remember off the top of my head :)

Like Alexander mentioned, it does look very different :)


> 
> 

Reply via email to