def fire
      $log.debug "menu fire called: #{text}  " 
      if @window.nil?
        #repaint
        # added 2011-09-24 adding ability to generate list of items
        if @item_list
          # generate a list, but we need to know what to do with that list.
          @items = []
          l = @item_list.call self, *@item_list_args if !@item_list.nil?
          if l.nil? || l.size == 0
            item(:NO_MENUITEMS)
          else
            # for each element returned create a menuitem, and attach the command to it.
            l.each { |e| it = item(e); 
              if @command # there should be a command otherwise what's the point
                it.command(@args) do @command.call(it, it.text) end;
              else
                it.command(@args) do alert("No command attached to #{it.text} ") end;
                $log.warn "No command attached to item_list "
              end
            }
          end
          $log.debug "menu got items #{@items.count} " 
        end
        if @items.empty? # user did not specify any items
            item(:NO_MENUITEMS)
        end
        create_window 
        if !@parent.is_a? Canis::MenuBar 
          @parent.current_menu << self
          @@menus << self # NEW
        end
      else
        ### shouod this not just show ?
        $log.debug "menu fire called: #{text} ELSE XXX WHEN IS THIS CALLED ? 658 #{@items[@active_index].text}  " 
        if @active_index # sometimes no menu item specified 2011-09-24 NEWMENU
          return @items[@active_index].fire # this should happen if selected. else selected()
        end
      end
      #@action.call if !@action.nil?
    end
def fire
      $log.debug "menu fire called: #{text}  " 
      if @window.nil?
        #repaint
        # added 2011-09-24 adding ability to generate list of items
        if @item_list
          # generate a list, but we need to know what to do with that list.
          @items = []
          l = @item_list.call self, *@item_list_args if !@item_list.nil?
          if l.nil? || l.size == 0
            item(:NO_MENUITEMS)
          else
            # for each element returned create a menuitem, and attach the command to it.
            l.each { |e| it = item(e); 
              if @command # there should be a command otherwise what's the point
                it.command(@args) do @command.call(it, it.text) end;
              else
                it.command(@args) do alert("No command attached to #{it.text} ") end;
                $log.warn "No command attached to item_list "
              end
            }
          end
          $log.debug "menu got items #{@items.count} " 
        end
        if @items.empty? # user did not specify any items
            item(:NO_MENUITEMS)
        end
        create_window 
        if !@parent.is_a? Canis::MenuBar 
          @parent.current_menu << self
          @@menus << self # NEW
        end
      else
        ### shouod this not just show ?
        $log.debug "menu fire called: #{text} ELSE XXX WHEN IS THIS CALLED ? 658 #{@items[@active_index].text}  " 
        if @active_index # sometimes no menu item specified 2011-09-24 NEWMENU
          return @items[@active_index].fire # this should happen if selected. else selected()
        end
      end
      #@action.call if !@action.nil?
    end
menu -