• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

I think I am going to cry

Collapse
X
  •  
  • Filter
  • Time
  • Show
Clear All
new posts

    #51
    This is correct. You don't.

    But I will play along. I should be charging you really.

    I have a button. I want to subscribe to the click event of that button. What do I pass to the button to subscribe to this event?

    Do not even consider using the word object in your answer or I will tear you a new one young Padawan


    Sent from my iMinion using Tapatalk
    Knock first as I might be balancing my chakras.

    Comment


      #52
      Originally posted by suityou01 View Post
      This is correct. You don't.

      But I will play along. I should be charging you really.

      I have a button. I want to subscribe to the click event of that button. What do I pass to the button to subscribe to this event?

      Do not even consider using the word object in your answer or I will tear you a new one young Padawan


      Sent from my iMinion using Tapatalk
      In a typical Observer pattern implementation, you'd pass to the button the subscriber itself.

      Comment


        #53
        Sneaky. Very sneaky.

        The answer was function pointer.


        Sent from my iMinion using Tapatalk
        Knock first as I might be balancing my chakras.

        Comment


          #54
          Ok. So I have two buttons. Can I pass the same function pointer to both buttons? Of course I can.

          Or I could supply multiple function handlers to each button. Here's the thing, if I add three event handlers to the same event, when that event fires the handler fire in the order that I subscribed them.

          Ok so far?


          Sent from my iMinion using Tapatalk
          Knock first as I might be balancing my chakras.

          Comment


            #55
            Originally posted by suityou01 View Post
            Sneaky. Very sneaky.

            The answer was function pointer.


            Sent from my iMinion using Tapatalk
            Maybe you're messing with me. Function pointer in Java?

            Comment


              #56
              Originally posted by suityou01 View Post
              Sneaky. Very sneaky.

              The answer was function pointer.


              Sent from my iMinion using Tapatalk
              But this is java, not X windows. So you end up with a new class.
              While you're waiting, read the free novel we sent you. It's a Spanish story about a guy named 'Manual.'

              Comment


                #57
                What does this do

                MyButton.ClickEvent += myHandler;

                Specifically discuss the bit to the right of the equals sign.

                Do not use the word object, class or instance.


                Sent from my iMinion using Tapatalk
                Knock first as I might be balancing my chakras.

                Comment


                  #58
                  The human head weighs eight pounds.

                  Comment


                    #59
                    8 pounds of wool in your case.


                    Sent from my iMinion using Tapatalk
                    Knock first as I might be balancing my chakras.

                    Comment


                      #60
                      Originally posted by suityou01 View Post
                      What does this do

                      MyButton.ClickEvent += myHandler;

                      Specifically discuss the bit to the right of the equals sign.

                      Do not use the word object, class or instance.


                      Sent from my iMinion using Tapatalk
                      In java? it prevents your code from compiling.
                      While you're waiting, read the free novel we sent you. It's a Spanish story about a guy named 'Manual.'

                      Comment

                      Working...
                      X