Results 1 to 9 of 9
  1. rezistrat's Avatar
    Posts
    14 Posts
    Global Posts
    16 Global Posts
       #1  
    I'm trying to assign several buttons in a scene to stamp the time on a field below the button after being pressed.

    Can anyone give me some advice as to how to do this?
  2. #2  
    this.controller.listen('button id', Mojo.Event.tap, this.function_to_call.bind(this));
  3. rezistrat's Avatar
    Posts
    14 Posts
    Global Posts
    16 Global Posts
       #3  
    Thanks ever so much
  4. #4  
    Ares is very good about taking care of this type of stuff. For instance if you were to put a button and go to the event's tab of the button's properties, it'll show you the possible events and you can just type a name and it'll create the listener for you and even the called method.

    However, obviously you should take care to know what's going on behind the scenes or else you might start producing much more troubled code.
  5. rezistrat's Avatar
    Posts
    14 Posts
    Global Posts
    16 Global Posts
       #5  
    Okay, I'm really clueless and I need to go through the SDK tutorial.

    I think this whole processes is way over my head. However, what I want to do seems to me at least not too complicated.

    A button which when pressed will input the current time in a text field below or to the side of it. (It's essentially for my work need to chart the time of certain events, when I'm away from my computer, I could use my phone with this app).

    Then maybe an ability to erase this data for the whole scene so as to start over again.
  6. #6  
    Quote Originally Posted by snoopgoat View Post
    this.controller.listen('button id', Mojo.Event.tap, this.function_to_call.bind(this));
    Instead of passing in "this.function_to_call.bind(this)", you should be setting your handler function to a variable and using that in the listen call.

    So for instance, in your Assistant's Initialize function, you would do something like this:

    Code:
    this.yourHandler = this.function_to_call.bindAsEventListener(this);
    Then when you call the listen function (or stopListening), you'll pass in "this.yourHandler" instead of "this.function_to_call.bind(this)". If you pass in "this.function_to_call.bind(this)" to both the listen and stopListening functions, you'll be creating 2 separate references to the function. Speaking of stopListening, make sure you always call this once you no longer need the listener.
    Quick Post: The quick way to post messages and photos to Twitter & Facebook (video link)
    Music Player (Remix): The next generation music listening experience on webOS (video link)
    GeoStrings: Set location-based reminders and never forget another task (video link)

    Twitter: @Hedami
  7. #7  
    Quote Originally Posted by Rezistrat View Post
    Okay, I'm really clueless and I need to go through the SDK tutorial.

    I think this whole processes is way over my head. However, what I want to do seems to me at least not too complicated.

    A button which when pressed will input the current time in a text field below or to the side of it. (It's essentially for my work need to chart the time of certain events, when I'm away from my computer, I could use my phone with this app).

    Then maybe an ability to erase this data for the whole scene so as to start over again.
    you just need one button to enter the time once into a text field? do you need to copy the text, or can it just be in an uneditable text field?
    My site: Shanerooni, LLC
    Follow me on Twitter
    My apps: GuessWhat? | MazeHunter3D | Small Wonders | PhakePhoney | AutismAware | PicSketcher | Cubix | QuickSolve | QuickSpell | QuickTrace | QuickWhack | QuickSuite | Soccer Shots | Ballooning |
    Cubix
  8. rezistrat's Avatar
    Posts
    14 Posts
    Global Posts
    16 Global Posts
       #8  
    The text can be uneditable. I suppose it doesn't have to be a text field. The other option is the Time pick widget if there was some way to use the button to automatically select the current time in the time pick. Just not sure how to do that.
  9. #9  
    Quote Originally Posted by Rezistrat View Post
    The text can be uneditable. I suppose it doesn't have to be a text field. The other option is the Time pick widget if there was some way to use the button to automatically select the current time in the time pick. Just not sure how to do that.
    what format? HH:MM:SS?

    i have an app that works for you. PM me an email addr and i'll send you the ipk. it's VERY VERY simple, but you are welcome to unpackage it and see what i did. we'll consider it open source

    if you want it to be pretty or have some more advanced features, i can definitely work with you on that if you need help.

    cheers
    Last edited by shanerooni; 02/04/2010 at 02:26 PM.
    My site: Shanerooni, LLC
    Follow me on Twitter
    My apps: GuessWhat? | MazeHunter3D | Small Wonders | PhakePhoney | AutismAware | PicSketcher | Cubix | QuickSolve | QuickSpell | QuickTrace | QuickWhack | QuickSuite | Soccer Shots | Ballooning |
    Cubix

Posting Permissions