Cant add item ih the list

Problem i have is with method called wordMenu() which is inside method called show(). Problem is that last line of method wordMenu() should add newly created words to the mDatabase.
If i use method listWords() (SWITCH 3) i see newly added words on the bottom of the list which is intended. But they never appear if i run the game test again (SWITCH 1). Those newly created words by user should
be added to the mDatabase and program should be able to use them to create new random word list for test.
I dont understand why newly created words appear if i just list words by method from switch 3 but they do not appear in new test-switch1, can someone help me understand and fix this problem with my program.
import java.util.Scanner;
* Class which interacts with user using scanner.
* And runs the main method of the program.
public class Menu
    public Scanner mScanner;
    private static  TestGenerator mGenerator = new TestGenerator();
    private WordDatabase mDatabase;
    * Constructor for objects of class Menu
   public Menu()
        mScanner = new Scanner(System.in);
        mDatabase = new WordDatabase();
     * Main method that runs our program.
     * From welcome menu trough test or adding new words.
     * Up to the goodbye screen.
   public void show()
        login();
        while(true)
            welcomeMenu();
            if(!mScanner.hasNextInt())
                System.out.println(mScanner.nextLine() + " är inte giltigt input");
                continue;
            int option = mScanner.nextInt();
             switch(option)
                case 1:
                    //clearScreen();
                    Test test = mGenerator.generateNewTest();
                    test.start();                  
                break;
                case 2:
                    clearScreen();
                    wordMenu();
                    clearScreen();
                break;
                case 3:
                    clearScreen();
                    listWords();
                break;
                case 4:
                     clearScreen();
                     if(goodbyeMenu()){
                          return;
                     else{
                break;
                default:
                    System.out.println("--> Förstår inte <--");
                break;
    * Method that list all words currently in database.
   private void listWords()
        for(int i = 0; i < mDatabase.size(); i++)
            System.out.println(mDatabase.get(i));
        System.out.println();
     * Method that prints out welcome text.
     * Helps with keeping main method easier to understand.
   private void welcomeMenu()
        System.out.println("Hej och välkommen till Igor's glostränare!");
        System.out.println();
        System.out.println("1.Kör glostest");
        System.out.println("2.Registera ord");
        System.out.println("3.Skriv ut alla glösor.");
        System.out.println("4.Avsluta testet.");
        System.out.println();
        System.out.print("Vad vill du göra ? --> ");
    * Method that takes users name.
    * Helps with keeping main method easier to understand.
   private void login()
       System.out.print("Ditt namn: ");
       mScanner.nextLine();  
       System.out.print("\f");
     * Method that allows user to add new words into database.
   private void wordMenu()
           System.out.println();
           System.out.println("Lägga till ord menyn");
           System.out.println();
           System.out.print("Svenska:-->");
           String Svenska = mScanner.next();
           System.out.println();
           System.out.print("Engelska:-->");
           String Engelska = mScanner.next();
           System.out.println();
           System.out.print("-->");
           System.out.println(Svenska + ":" + Engelska);
           System.out.println();
           Word word = new Word(Svenska, Engelska);
           mDatabase.add(word);    
     * Method that creates goodbye screen.
   private boolean goodbyeMenu()
        System.out.println("Är du säker att du ska avsluta program");
        System.out.println();
        System.out.println(" 1 - avsluta");
        System.out.println(" 2 - gå tillbaka");
        System.out.print("-->");
        int input = mScanner.nextInt();
        if(input == 1){
            return true;
        else{
            return false;
     * Method that clears the screen allowing better overwiev.
   private void clearScreen()
      System.out.print('\u000C');
}Another class which holds method start()
import java.util.ArrayList;
import java.util.Iterator;
* Class that runs test and counting results.
public class Test
    private ArrayList<Word> mTestWords;
    private int mScore;
     * Constructor for objects of class Test.
     * @param is ArrayList wordlist from class Word.
    public Test(ArrayList<Word> wordList)
       mTestWords = wordList;
       mScore=0;
     * Method which count and print out test results.
    public void start()
        System.out.println("Nu startar testet");
        Iterator<Word> it = mTestWords.iterator();
        while(it.hasNext())
            if(it.next().answer())
                mScore++;
        System.out.println("Testet avlklarat; " + mScore + "/" + mTestWords.size());
} Third class that generates test
mport java.util.ArrayList;
* This class generates tests using class RandomN and WordDatabase.
public class TestGenerator
    private RandomN mRandom;  
    private WordDatabase mDatabase;
     * Constructor for objects of class TestGenerator.
    public TestGenerator()
        mDatabase = new WordDatabase();
        mRandom = new RandomN(mDatabase.size());
     * Method that add new words to our wordlist.
     * @param new (word).
    public void addWord(Word word)
        mDatabase.add(word);
        mRandom = new RandomN(mDatabase.size());
     * Method which randomly pick values from our database.
     * @return  Test randomly picked values from database list.
    public Test generateNewTest()
        ArrayList<Word> wordlist = new ArrayList<Word>();
        for(int i = 0; i < 10; i++)    
            int max = mDatabase.size();
            Word word = mDatabase.get(mRandom.getRandomValue(max));
            while(wordlist.contains(word))
                word = mDatabase.get(mRandom.getRandomValue(max));
            wordlist.add(word);    
        return new Test(wordlist);
}Edited by: 901605 on 2011-dec-10 12:32
Edited by: 901605 on 2011-dec-10 12:35
Edited by: 901605 on 2011-dec-10 12:37

Because you're using 2 word databases, when you apparently want only one.
The mDatabase in your Menu class is used for adding the words and displaying, but in your TestGenerator class you create another mDatabase to be used for creating the random tests.

Similar Messages

  • How to create new subsite while adding new item to the list by using javascript?

    hi,
    I hav a task ie, when I add item to the list then subsite will create with that list item title and description . So By using javascript, I have to create subsite while adding new item to the list.
    Help me to solve this.
    Thank you, 

    Is your item getting added through Javascript client object model ? If yes, you can write in the success delegate of your list creation method the logic to create the subsite.
    function CreateListItem()
    var clientContext = new SP.ClientContext.get_current();
    var oList = clientContext.get_web().get_lists().getByTitle('List Name');
    var itemCreateInfo = new SP.ListItemCreationInformation();
    this.oListItem = oList.addItem(itemCreateInfo);
    oListItem.set_item('Title', 'My New Item!');
    oListItem.set_item('Body', 'Hello World!');
    oListItem.update();
    clientContext.load(oListItem);
    clientContext.executeQueryAsync(Function.createDelegate(this, this.CreateListItemOnSuccess), Function.createDelegate(this, this.onQueryFailed));
    function CreateListItemOnSuccess() {
    var subsiteTitle = oListItem.get_item('Title');
    //Logic to create a subsite
    function onQueryFailed(sender, args) {
    I have added a sample flow for the above scenario. Have a look at the following lnk for how you can craete a subsite using ecmascript.
    http://ravisoftltd.wordpress.com/2013/03/06/sharepoint-2010-create-site-with-ecma-script-with/
    Geetanjali Arora | My blogs |

  • I downloaded the new 6.0 and now my shopping list app closes when i try to add an item to the list

    I downloaded the new update 6.0 to my Iphone4 and one of my favorite apps the ShoppingList wont let me add an item to the list. It closes completely when I select to add button. I have tried turning phone off and on and this hasn't helped any. Got any suggestions?

    Purchases are tied to the Apple ID they were purchased with. If you use a new ID, you have to buy again.

  • Add object in the list

    hi how are you guys ? i hope you all fine ..
    here ...
    iam trying to show the list items in the list .. but i couldn.t here
    first i created object and array object
    var za:int = 0
    var itemsinfo:Object = new Object()
    var da:Array = new Array (100)
    then in another place  i set the properties for the object , andi made them arrays objects like this
    itemsinfo.name1 = new Array()
       itemsinfo.price1 = new Array()
    after that i,ve crated 2 text boxes , one for the item value and the second for the price
    additemsvar = additems.text
       addpricevar = int (addprice.text)
    then i checked the values in the object
    for (var z:String in itemsinfo){
        trace (z + ":" + itemsinfo[z])
    and  every thing is good , but the probelm is when i add these arrays to to the list object, it doesn,t work
    i.ve tried with 3 deffrent ways
    listbox1.addItem ({label:String(itemsinfo.name1[za])}) //displaying undefined in the list
       listbox1.addItem ({label:(itemsinfo.name1[za])}) //displaying nothing and it just take a place
    listbox1.addItem (itemsinfo.name1[za])  // nothing happend
    thank you

    iam not realy sure if i can understand you , but how can i fix it
    listbox1.addItem (...)
    here is the full code
    package {
    import flash.display.MovieClip;
       import flash.events.MouseEvent
       import flash.events.Event;
    public class MAIN  extends MovieClip {
      var additemsvar:String
      var addpricevar:int
      var removeitemvar:int
      var itemsnp:Array = new Array (100)
      var itemsinfo:Object = new Object()
      var za:int = 0
      var da:Array = new Array (100)
      public function MAIN () {
        addbutton.addEventListener(MouseEvent.CLICK ,addbutton1)
        removebutton.addEventListener(MouseEvent.CLICK ,removebutton1)
        addEventListener(Event.ENTER_FRAME , onEnterFrame)
      addEventListener(Event.ADDED_TO_STAGE,ADDED_TO_STAGE)
      public function ADDED_TO_STAGE (event:Event){
       itemsinfo.name1 = new Array()
       itemsinfo.price1 = new Array()
      public function onEnterFrame (event:Event){
       if(listbox1.selectedIndex != -1){
       itemname11.text = String({label:listbox1.getItemAt(listbox1.selectedIndex)})
      public function addbutton1 (event:MouseEvent){
       additemsvar = additems.text
       addpricevar = int (addprice.text)
       listbox1.addItem ({label:String(itemsinfo.name1[za])})
       listbox2.addItem ({label:itemsnp[za]})
       itemsinfo.name1.push (additemsvar)
       itemsinfo.price1.push (addpricevar)
       za += 1
       trace (itemsinfo.name1)
       for (var z:String in itemsinfo){
        trace (z + ":" + itemsinfo[z])
      public function removebutton1 (event:MouseEvent){
       trace (listbox1.selectedIndex)
       listbox1.removeItemAt(listbox1.selectedIndex)
      function traceItemsnpF(a:Array):void{
    for(var i:int=0;i<a.length;i++){
    for(var s:String in a[i]){
    trace(s,a[i]+":"+a[s]);
    thank you for the replay

  • Display the current item in the list without advancing the iteration using

    This is my directions.
    Display the current item in the list without advancing the iteration using only iterator methods.
    I can't seem to figure this one out when the only methods available are hasNext();, next();, hasPrevious();, previous();, add();, remove();. and set();, and nextIndex();. Can someone please give me advice on this one?
    Thanks a bunch!!!!

    After thinking briefly about an ugly megillah that would detect whether or not you've ever called Iterator.next(), which is what is required for a bulletproof solution, I've decided after looking at the documenation that in fact the problem is not valid.
    It's as simple as this: the Javadoc says 'a ListIterator has no current element'.
    Tell your professor.

  • Defaulting a dropdown to the first item in the list

    I have two dropdowns in InfoPath 2010. The second dropdown gets populated depending on what the first dropdown is set to.
    Example: If the first is set to Florida, the second will display all the cities in Florida. If you set the first to Georgia, the second will change to a list of cities in Georgia.
    The problem is that it defaults to a blank line, I need the first item in the second dropdown to populate with the first item in the list.
    I've scoured the web but I can't seem to find a solution.
    Any solutions or workarounds?

    Hi,
    To achieve your requirement,  creating cascading dropdown fields with InfoPath.
    Please refer to the following blogs about creating cascade drop down in InfoPath form step by step:
    http://blogs.msdn.com/b/bharatgupta/archive/2013/03/07/create-cascading-dropdown-in-browser-enabled-infopath-form-using-infopath-2010.aspx
    For the issue that second dropdown defaults to a blank line, add a formatting rule to the first dropdown. Refer to the following articles:
    http://www.pointbeyond.com/2011/11/20/cascading-dropdowns-in-infopath-2010/
    http://msreddysharepoint.blogspot.in/2012/12/infopath-2013-web-browser-creating.html
    Best Regards,
    Lisa Chen
    Lisa Chen
    TechNet Community Support

  • Required field, UPC, is missing. Please add UPC to the listing and retry the operation.

    What to do about this: "Required field, UPC, is missing. Please add UPC to the listing and retry the operation." ? We sell cassette tapes and sometimes they are are of a vintage that predates upc codes.

     forester_studios wrote:OK thanks for the input; but selecting 1 item leaves the other 4 or 5 unsearchable I would think.  Seems like a typical ebay answer (which is not much better than no answer as far as problem solving goes).   I have to wonder if ebay thought this new requirement through.  Often upc codes on Canadian items are not in ebays system at all.  So are these items which have upc codes un-listable  since ebay does not acknowledge they exsist? In that case, here is what I intend to do.... List the most important item's UPC in the actual required UPC field and then create as many other 'custom' item specific UPC fields as are allowed. You need to be on the long form selling form to do it. Call them Other UPC and Even More UPC or something. And then, just to be sure, I'll list all the UPCs in the item description.  Buyers probably won't search for UPC (unless they're standing in a retail store with their smartphone in hand and looking for cheaper pricing online) but search engines do. When I look for the products that I sell on google, I get amazon results 19 times before I see one from eBay. I'm certain that's the UPC talking there. We do need Product Identifiers on eBay. Implementing them is the difficulty. Ebay is aware that the UPC for Canadian packages may be different than the exact same in an American one. I've raised it and was told they were looking into it. Use the MPN identifiers too. Pretty much nothing I list can be found in the product catalogue on ebay.ca (is there one?) so I don't know what to expect for resolution there if and when the Catalogue version of the Product Identifiers are shown to be clearly wrong but I know it happens, here and elsewhere. The last order that I placed with Amazon had a new UPC pasted over an old, similar product. It was not what I ordered. Close but no cigar. Hopefully, when all of this becomes 'official' in two weeks, there will be a timely manner to address item misinformation within the Product Catalogue. In the meantime, I would state all the item properties in the Item Description area to cover my butt.   

  • Can not add item to the shopping Cart with FireFox 8.0

    I can not add items to the shopping cart with Firefox 8.0. Switch to IE everything works then.

    Such details are stored in a cookie, so make sure that you do not block cookies on that site.
    *Tools > Page Info > Permissions
    You can inspect and manage the permissions for all domains on the <b>about:permissions</b> page via the location bar.
    *http://kb.mozillazine.org/Cookies
    *http://kb.mozillazine.org/Websites_report_cookies_are_disabled

  • When I want to add items to the bookmarks toolbar, for example: -Zoom toolbar. The zoom Toolbar appears on the bookmarks toolbar, but it shows the favicons aswell the underlined text. I only want the favicons. How to do this, please help!!

    I want to add items to the bookmarks toolbar. for example: the Zoom Toolbar addon. This works, but not only the favicons appear on the bookmarks toolbar, aswell as the underlined text. How to avoid this?
    I only want the favicons from an addon to appear on the bookmarks toolbar, not with the underlined text. How to do this?
    This problem doesn't happen with any other toolbar. And this problem didn't happen with an earlier version of firefox. Please Help!
    Thanx, BassMann.

    If you only want the favicons and not the names of the bookmarks on the bookmarks toolbar, you can do that with the [https://addons.mozilla.org/en-US/firefox/addon/4072/ Smart Bookmarks Bar] add-on.

  • Add me to the list of Unhappy Razr M users after KitKat.

    Add me to the list of Unhappy Razr M users after the KitKat 'upgrade'
    I did a quick Google search and found that many people were having issues after upgrading to KitKat.
    If I disable my Bluetooth connection to my portable speaker I can connect to my router and the Internet.
    If I have Bluetooth on and connected to anything Bluetooth my WiFi shows that it's connected but it will not actually connect to the Internet.
    I have restarted the phone, restarted the router, unpaired everything and re-paired everything, re-discovered the WiFi and re-added my home Internet connection on the phone and router. The Internet connection problem is only there when I have the phone connected to something Bluetooth.
    Surely this can't be considered acceptable since I had a perfectly functioning phone on Thursday morning at 8am and by 9am I now have a phone that won't connect to WiFi and Bluetooth at the same time.
    Please fix this Verizon, this issue is not at my end!

    A knowledgeable gent recently reported it as "soon".
    <br />
    <br />What I suggest is folks in your situation- and others- is to import a small number of images, be it a few hundred per folder or so, or less, and see how LR works. Give it time to create previews, and then work with it.
    <br />
    <br />Best wishes,
    <br />
    <br />
    <span style="color: rgb(102, 0, 204);"></span>
    <font br="" /></font> color="#600000" size="2"&gt;~~ John McWilliams
    <br />
    <br />
    <br />
    <br />MacBookPro 2 Ghz Intel Core Duo, G-5 Dual 1.8; Canon DSLRs

  • How to get items from a list that has more items than the List View Threshold?

    I'm using SharePoints object model and I'm trying to get all or a subset of the items from a SharePoint 2010 list which has many more items than the list view threshold (20,000+) using the SPList.GetItems() method. However no matter what I do the SPQueryThrottledException
    always seems to be thrown and I get no items back.
    I'm sorting based on the ID field, so it is indexed. I've tried setting the RowLimit property on the SPQuery object(had no effect). I tried specifying the RowLimit in the SPQuerys ViewXml property, but that still throws a throttle exception. I tried using the
    ContentIterator as defined here:http://msdn.microsoft.com/en-us/library/microsoft.office.server.utilities.contentiterator.aspx,
    but that still throws the query throttle exception. I tried specifying the RowLimit parameter in the ProcessListItems functions, as suggested by the first comment here:http://tomvangaever.be/blogv2/2011/05/contentiterator-very-large-lists/,
    but it still throws the query throttle exception. I tried using GetDataTable instead, still throws query throttle exception. I can't run this as admin, I can't raise the threshold limit, I can't raise the threshold limit temporarily, I can't override the lists
    throttling(i.e. list.EnableThrottling = false;), and I can't override the SPQuery(query.QueryThrottleMode = SPQueryThrottleOption.Override;). Does anyone know how to get items back in this situation or has anyone succesfully beaten the query throttle exception?
    Thanks.
    My Query:
    <OrderBy>
        <FieldRef Name='ID' Ascending='TRUE' />
    </OrderBy>
    <Where>
        <Geq><FieldRef Name='ID' /><Value Type='Counter'>0</Value></Geq>
    </Where>
    My ViewXml:
    <View>
        <Query>
            <OrderBy><FieldRef Name='ID' Ascending='TRUE' /></OrderBy>
            <Where>
                <Geq><FieldRef Name='ID' /><Value Type='Counter'>0</Value></Geq>
            </Where>
        </Query>
        <RowLimit>2000</RowLimit>
    </View>
    Thanks again.

    I was using code below to work with 700000+ items in the list.
    SPWeb oWebsite = SPContext.Current.Web;
    SPList oList = oWebsite.Lists["MyList"];
    SPQuery oQuery = new SPQuery();
    oQuery.RowLimit = 2000;
    int intIndex = 1;
    do
    SPListItemCollection collListItems = oList.GetItems(oQuery);
    foreach (SPListItem oListItem in collListItems)
    //do something oListItem["Title"].ToString()
    oQuery.ListItemCollectionPosition = collListItems.ListItemCollectionPosition;
    intIndex++;
    } while (oQuery.ListItemCollectionPosition != null);
    Oleg
    Hi Oleg, thanks for replying.
    The problem with the code you have is that your SPQuery object's QueryThrottleMode is set to default. If you run that code as a local admin no throttle limits will be applied, but if you're not admin you will still have the normal throttle limits. In my
    situation it won't be run as a local admin so the code you provided won't work. You can simulate my dilemma by setting the QuerryThrottleMode  property to SPQueryThrottleOption.Strict, and I'm sure you'll start to get SPQueryThrottledException's
    as well on that list of 700000+ items.
    Thanks anyway though

  • Hide "more" button in a list view, only works for first item in the list

    I have the following code in a list view that outputs several dozen items in a web app.  The code only works for the first item, how can I make it loop through and execute the test for each item in the list view?  The {tag_hide more button} is a checkmark field that yields a numeric 1" if checked otherwise yields a numeric "0".
    <div id="more-option">
            <p class="right"><a href="{tag_itemurl_nolink}" class="btn btn-small btn-very-subtle">More &rarr;</a></p>
          </div>
          <div class="more-selection" style="display: none;">{tag_hide more button}</div>
          <script>
    if ($(".more-selection").text() == "1") {
        $("#more-option").hide();
    </script>

    What's the URL for the site where you are using this?  Offhand, it looks like it should work with your first example so you are either placing the script before those elements are loaded or you might try wrapping your current javascript inside the:
    $(document).ready(function() {
    --- your existing javascript here
    This make sure the code runs once all the html is loaded on the page.  Without seeing a URL and debugging with the js console in Chrome I can't give you a solid answer.
    But, I do know that you can probably do this with a lot less markup.  Once we figure out what the actual problem is I have a better solution mocked up for you on jsfiddle.
    When looking at my HTML code on jsfiddle, please realize I setup some dummy HTML and removed your tags and added actual values which would be output by your tags.  The main thing I did was remove the whole div.more-selection and instead, added a "data-is-selected" attribute on your div.more-option element.  Then, in my javascript for each div.my-option element on the page, we loop through them, find the value of that data attribute and hide that div if it's less than 1 (or 0).
    Here's the fiddle for you to look at:  http://jsfiddle.net/thetrickster/Mfmdu/
    You'll see in the end result that only two divs show up, both of those divs have data-is-selected="1".
    You can try pasting the javascript code near the closing </body> tag on your page and make sure to wrap my js inside a <script> tag, obviously.  My way is neater on the markup side.  If you can't get it to work it's likely a jquery conflict issue.  My version is using the $(document).ready() method to make sure all the code is loaded before it runs.
    Best,
    Chris

  • How can i show the first item in the list as selected item

    Aslam o Alikum (Hi)
    Dear All
    How can i show the first item in the list as selected item when user click on the list. Right now when user click the list the list shows the last item in the list as selected or highlighted. Furthermore if the list item have large no of value and a scroll bar along with it then the list scroll to last item when user click it with mouse. I want that when user click the list item with mouse list should show the first item as highlighted.
    Take Care
    Allah Hafiz

    Hi!
    You can set list "initial value" using When-Create-Record trigger.
    I.g.
    :<Block_name>.<list_item_name> := Get_List_Element_Value('<Block_name>.<list_item_name>', 1);

  • Am trying to install CS6 on my new MacBook Pro. Downloaded installer from web. Ran installer, got a dialog asking me to "Please close these applications to continue:..." There were two items on the list: Safari

    "Please close these applications to continue:..." There were two items on the list: Safari & SafariNotificati (sic). I closed Safari, no problem. But could not find SafariNotifications.
    What I have done so far:
    Opened "Force Quit" and the only applications listed as open now are "Finder" and "Adobe Application Manager".
    Pressed "Continue" on the "Please close..." dialoge
    Still asks me to close SafariNotificati
    Opened Safari
    Opened Safari Preferences > Notifications Tab
    There are no notifications listed. The list is blank.
    Closed Safari again.
    Checked Force Quit again (once again the only applications listed are "Finder" and "Adobe Application Manager"
    Once again if I try to move on with the install by clicking on the "Continue" button Adobe asks me to close SafariNotificati
    What should I do now?
    My System Info
    MackBook Pro (Retina, 15-inch, Mid 2014)
    OS X Yosemite
    Ver 10.10.1

    use your activity monitor to find running processes.

  • [SOLVED] How to Add Items in the Awesome Menu?

    I hate to ask, but I've gotta say I've read the manuals extensively, and can't figure out certain things in awesome... I want to purchase a lua programming manual to have around, but in the meantime... I'm hoping one of you guys can throw me a bone here and help me figure out this one thing...
    I've added firefox to my awesome menu so now it's like awesome > open terminal > firefox. However, nothing happens when I select firefox, and here's my code:
    -- {{{ Menu
    -- Create a launcher widget and a main menu
    myawesomemenu = {
       { "manual", terminal .. " -e man awesome" },
       { "edit config", editor_cmd .. " " .. awesome.conffile },
       { "restart", awesome.restart },
       { "quit", awesome.quit }
    mymainmenu = awful.menu({ items = { { "awesome", myawesomemenu, beautiful.awesome_icon },
                                    { "open terminal", terminal },
                    { "firefox", awful.util.getdir("config") .. "/firefox.png" }
    mylauncher = awful.widget.launcher({ image = beautiful.awesome_icon,
                                         menu = mymainmenu })
    -- Menubar configuration
    menubar.utils.terminal = terminal -- Set the terminal for applications that require it
    Anyone know what I'm doing wrong?
    Last edited by w201 (2013-03-02 04:49:11)

    The syntax for adding a menu item to awesome goes like this:
    mywebmenu = {
    {" Chromium", "chromium-browser", beautiful.chromium_icon},
    {" Dropbox", "dropbox", beautiful.dropbox_icon}
    or
    mysettingsmenu = {
    {" WICD", "urxvt -x wicd-curses", beautiful.wicd_icon}
    As you can see, the first item in the list is the name of the menu item, the second is the command to be run, and the third is the icon to be displayed. If there's no third field, no icon is displayed.
    Your code for adding firefox to your menu will correctly show "firefox" as the menu name being displayed, since that's the first field you added, but will attempt to execute "awful.util.getdir("config") .. "/firefox.png"  when you click the menu item, since that's what you provided as the second argument. Since that's not an executable command, nothing happens.
    Since the "awful.util..." bit seems to be you trying to get the proper icon for firefox, I suggest adding an element to the list between the two you already have that is just "firefox". This will ensure that when you click on "firefox" in your menu, the command that is run is "firefox", which should launch your browser.
    Last edited by dcalacci (2013-03-01 21:21:01)

Maybe you are looking for