>
> On 21 Dec 2009, at 15:14, manolo gouy wrote:
>
> > - FL_MENU_RADIO is now working in Fl_Sys_Menu_Bar
>
> Well, maybe... Someone else will need to test this to confirm, but in
> my hacked up menubar demo (hacked to use sys_menu_bar for testing)
> the FL_MENU_RADIO entries *mostly* work, but I see something odd...
>
> Try this: the radio button menu entry in the menubar demo has three
> sections separated by divider lines, and in the plain Fl_Menu version
> you can select one entry in each section - so the divide lines are
> acting like groups.
>
> Now, in the Fl_Sys_Menu version, I find that there is some sort of
> interaction between the "groups"; so if I set a button in group 1,
> then set a button in group 2, the button in group 1 will be
> cleared... If I then set a button in group 3, the button in group 2
> will be cleared, and so on.
>
> But, the buttons in group 1 don't seem to affect the buttons in group
> 3, and vice versa.
>
> Odd.
>
> No idea what that is about.
>
>

Ian: I was thinking "shit, my function won't work with series
of radio items separated by a divider. I have to correct that."
It was not long until you found this problem!

Please, change in function doCallback of file Fl_cocoa.mm
the full else if with FL_MENU_RADIO clause by this one:

    else if ( item->flags & FL_MENU_RADIO ) {// update the menu radio symbols
      int from = flRank;
      while( from > 0 && items[from - 1].label() && (items[from - 1].flags & 
FL_MENU_RADIO) &&
            !(items[from - 1].flags & FL_MENU_DIVIDER) ) {
        from--;
        }
      int to = flRank;
      while( !(items[to].flags & FL_MENU_DIVIDER) && items[to + 1].label() &&
            (items[to + 1].flags & FL_MENU_RADIO) ) {
        to++;
        }
      NSMenu *nsmenu = [self menu];
      int nsrank = (int)[nsmenu indexOfItem:self];
      for(int i =  from - flRank + nsrank ; i <= to - flRank + nsrank; i++) {
        NSMenuItem *nsitem = [nsmenu itemAtIndex:i];
        if(nsitem != self) [nsitem setState:NSOffState];
        else [nsitem setState:(item->value() ? NSOnState : NSOffState) ];
        }
      }

_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to