lib/wmiirc/menu.rb
##
# Shows a menu (where the user must click a menu
# item using their mouse to make a choice) with
# the given items and returns the chosen item.
#
# If nothing was chosen, then nil is returned.
#
# ==== Parameters
#
# [choices]
#   List of choices to display in the menu.
#
# [initial]
#   The choice that should be initially selected.
#
#   If this choice is not included in the list
#   of choices, then this item will be made
#   into a makeshift title-bar for the menu.
#
Shows a menu (where the user must click a menu
item using their mouse to make a choice) with
the given items and returns the chosen item.

If nothing was chosen, then nil is returned.

Parameters

[choices]
List of choices to display in the menu.

[initial]
The choice that should be initially selected.

If this choice is not included in the list
of choices, then this item will be made
into a makeshift title-bar for the menu.
Shows a menu ( where the user must click a menu item using their mouse to make a choice ) with the given items and returns the chosen item . If nothing was chosen then nil is returned . Parameters [ choices ] List of choices to display in the menu . [ initial ] The choice that should be initially selected . If this choice is not included in the list of choices then this item will be made into a makeshift title - bar for the menu .
def click_menu choices, initial = nil
    command = ['wmii9menu']
    if initial
      command << '-i'
      unless choices.include? initial
        initial = "<<#{initial}>>:"
        command << initial
      end
      command << initial
    end
    command.concat choices
    choice = `#{command.shelljoin}`.chomp
    choice unless choice.empty?
  end
def click_menu choices , initial = nil command = [ 'wmii9menu' ] if initial command << '-i' unless choices . include? initial initial = "<<#{initial}>>:" command << initial end command << initial end command . concat choices choice = ` #{ command . shelljoin } ` . chomp choice unless choice . empty? end
Shows a menu (where the user must click a menu
item using their mouse to make a choice) with
the given items and returns the chosen item.
Shows a menu ( where the user must click a menu item using their mouse to make a choice ) with the given items and returns the chosen item .
choices
<not_specific>
initial
<not_specific>