OnClick?

Home Forums General Programming OnClick?

Tagged: 

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #72295
    human fly
    Participant
      • Topics: 124
      • Replies: 1070
      • Total: 1194
      • ★★★★

      Hi Goodweather, if you’re out there: looking at your DS2 panel.

      I don’t understand OnClick methods.

      i have a simple test, with a LED that lights with
      ‘Called When Panel has finished loading’ (a little
      thing i’m using to check it has run), and i have
      made a button called ‘OnClick’, which calls a method
      when ‘Mouse is Down on this component’.

      all your OnClick methods rely on a header function: isPanelReady(),
      which is created in ‘miscellaneous’.

      my function goes:

      function tabOnClick()
      
      	-- No action if the panel is in bootstrap or program states
      	if not isPanelReady() then
      		return
      	end
      
      	led_startup = panel:getModulatorByName("led_startup")
      	led_startup:getComponent():setValue(0,false)
      
      end

      but nothing happens. what am i missing? (off to check again)

      #72296
      human fly
      Participant
        • Topics: 124
        • Replies: 1070
        • Total: 1194
        • ★★★★

        ok, got Mouse Down working. it was your isPanelReady thing,
        i have no idea what is going on there. i removed that and
        ‘OnClick’ works. have to see if it is triggered on startup,
        like some buttons i have, where i have to put a
        ‘panel loaded’ condition, to stop them while the panel loads.
        will now check if i have to do that with Mouse Down methods.

        would still appreciate some clarification on isPanelReady 😉
        cheers !

        #72297
        human fly
        Participant
          • Topics: 124
          • Replies: 1070
          • Total: 1194
          • ★★★★

          however, it appears (?) that CustomComponent does not
          handle ‘Mouse Down’. is that correct?
          working from a button, but i cannot click on my graphic EG
          to call a tab.

          is there a way of doing this? i would like to click on
          one of the graphic envelopes so that the tab switches
          to correspond.
          (not essential, but it is what i was wanting to do)

        Viewing 3 posts - 1 through 3 (of 3 total)
        • The forum ‘Programming’ is closed to new topics and replies.
        There is currently 0 users and 55 guests online
        No users are currently active
        Forum Statistics
        Threads: 2,495, Posts: 17,374, Members: 77,605
        Most users ever online was 12 on January 22, 2019 3:47 pm
        Ctrlr