0 Replies Latest reply on May 14, 2007 2:25 PM by onlysport

    Right Click Menu in Linux doesn't fire.. But only when it has a seperator!

    onlysport
      Ok heres the deal..

      Constructor:
      [code]
      menuItem = new ContextMenuItem('&Add Item');
      menuItem.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, this.addItem, false, 0.0, true);
      menuItem.separatorBefore = true;
      this.contextMenu.customItems.push(menuItem);

      // Seperator
      menuItem = new ContextMenuItem('&Delete Item');
      menuItem.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, this.deleteItem, false, 0.0, true);
      menuItem.separatorBefore = true;
      this.contextMenu.customItems.push(menuItem);
      [/code]

      Listener:
      [code]
      public function addItem(event:Event):void
      {
      trace("addItem");

      // Event handler function uses a static method to show
      // a pop-up window with the title, message, and requested buttons.
      Alert.buttonWidth = 80;
      Alert.yesLabel = "Add";
      Alert.noLabel = "Cancel";
      Alert.show("Are you sure you want to add new Item?", "Add Item", 3, null, this.addItem_Action);
      }
      [/code]

      Action Function:
      [code]
      public function addItem_Action(event:CloseEvent):void
      {
      if (event.detail==Alert.YES)
      {
      this.addItem(new Item());
      }
      }
      [/code]


      What it does: (Windows)
      ==========
      1. User right clicks and selects "Add Item"
      2. "addItem" gets traced
      3. They get asked a question "Are you sure?"
      4. User selects "Yes"
      5. It adds the item.

      What it does: (Linux)
      ==========
      1. User right clicks and selects "Add Item".
      2. NOTHING gets traced.
      3. NOTHING happens.

      Now this is the interesting part...
      Notice in the code above, the "seperatorBefore = true" line is there..

      Believe it or not this line of code is the problem..

      Removing this line of code (commenting it out) from any one of the contextMenuItems above will cause that item to respond under linux like it does in windows..

      Help anyone?? I like having the seperators there!!

      Has anyone heard of this issue before??