Results 1 to 6 of 6
  1.    #1  
    Hi,

    is it possible to put an icon on a Button, RadioButton or other Widgets?

    Thanks!
  2. #2  
    you can use the iconpath function. Here's an exemple :

    this.viewMenuModel = { label: $L('View Menu Demo'),
    items: [{label: $L('Demo'), command:'demo'},
    {label: $L('#1#'), command:'button-1'},
    {label: $L('Toadstool'), iconPath:'images/deadapp.png', command:'deadapp'}
    ]};

    this.controller.setupWidget(Mojo.Menu.viewMenu, undefined, this.viewMenuModel);
    this.toggleMenu = this.toggleMenu.bind(this)
    Mojo.Event.listen(this.controller.get('toggle_menu_button'), iconPath:'images/deadapp.png',Mojo.Event.tap, this.toggleMenu)
  3.    #3  
    This works for the Menu-Model, correct. But it does not works for buttons:

    Declaration in main-scene.html:
    <div id="buttonAutoInfos" x-mojo-element="Button">

    Setup in main-assistant.jsjsjs:
    this.controller.setupWidget("buttonAutoInfos",
    this.attributes = { },
    this.model =
    {
    iconPath:'images/autoinfos.png',
    disabled: false
    });
    this.controller.listen("buttonAutoInfos", Mojo.Event.tap, this.buttonAutoInfosPressed.bindAsEventListener(this));

    Anyone an idea?
  4. #4  
    Quote Originally Posted by rmuetzner View Post
    This works for the Menu-Model, correct. But it does not works for buttons:

    Declaration in main-scene.html:
    <div id="buttonAutoInfos" x-mojo-element="Button">

    Setup in main-assistant.jsjsjs:
    this.controller.setupWidget("buttonAutoInfos",
    this.attributes = { },
    this.model =
    {
    iconPath:'images/autoinfos.png',
    disabled: false
    });
    this.controller.listen("buttonAutoInfos", Mojo.Event.tap, this.buttonAutoInfosPressed.bindAsEventListener(this));

    Anyone an idea?
    In your model, you could try and add an img tag in the button label. (buttonLabel in this.model)

    I haven't tried it, but theoretically it's possible.
    WOG Dev - WebOS Group http://www.WebOSGroup.com
    PMP Dev - http://www.PimpMyPre.com
    Apps: WOG O.S.K., WOG Card Keeper, WOG Glowstick, WOG Kid Protect, PreLoad, PimpMySounds
  5.    #5  
    In your model, you could try and add an img tag in the button label. (buttonLabel in this.model)

    I haven't tried it, but theoretically it's possible.
    No, it does not work
  6.    #6  
    Ok, here is the solution:

    scene.html:
    <div class='palm-button autoInfos' name="emButton" id="emButton" x-mojo-tap-highlight="momentary">
    <div class="palm-button-wrapper">
    <div class="palm-account-icon icon button autoinfos"></div>
    <div class="add-account-button-label"></div>
    </div>
    </div>

    Your CSS:
    .palm-button.autoInfos {
    width: 90px;
    height: 52px;
    }

    .palm-account-icon.autoinfos
    {
    background: url(../images/autoinfos.png) center center no-repeat;
    }


    You can layout your button-size or whatever in the css...

Posting Permissions