on textChanged equivalent for buttons pressed?

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller

Post Reply
jalz
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 340
Joined: Fri Sep 12, 2008 11:04 pm

on textChanged equivalent for buttons pressed?

Post by jalz » Tue Jun 09, 2015 10:44 am

Hi Guys,

Now that I have my applyScrollBars script working almost exactly as I want it, I've put it/called it from the resizeCard handler which activates the scrollbars on my card depending on whether the user has dragged the card is too small to fit in all the content on that card.

I've got various scripts which move positions of objects around my card depending on various states such as when things are being edited verses static information display. I can call the applyScrollBar on each time I press a button to check whether the card needs a scrollbar, however I was wondering whether their was an equivalent of the on textChanged handler which worked when I fired off a button. Ideally I would like the applyScrollBar to be activated after every button (or ideally a list of buttons) had been pressed on that card. I know it will affect performance slightly but I've got to try it out. Alternatively I'll tag my script after every button on my card.

Many thanks

Jalz

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 6266
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: on textChanged equivalent for buttons pressed?

Post by dunbarx » Tue Jun 09, 2015 2:08 pm

Hi.
I would like the applyScrollBar to be activated after every button (or ideally a list of buttons) had been pressed on that card.
Would "mouseUp" work? You would have to place "applyScrollBar" either in each local mouseUp button handler, or pass each mouseUp handler to another one in either the card or stack script .

I assume I have this wrong.

Craig Newman

jalz
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 340
Joined: Fri Sep 12, 2008 11:04 pm

Re: on textChanged equivalent for buttons pressed?

Post by jalz » Tue Jun 09, 2015 7:53 pm

Hi Craig

Yes I know I can apply my script to the to the local mouseUp handler on each button, I just wanted to know if there was global mouseUp handler where I could just instruct the card to call my script when any button is pressed. I think to solve this one quickly so I can move on I'll just call my script from each button that may have an impact on objects moving around on my card.
Thanks

Jalz

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 6266
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: on textChanged equivalent for buttons pressed?

Post by dunbarx » Tue Jun 09, 2015 8:51 pm

Hi.

The concept of a "global" handler is sort of built-into the message passing hierarchy in the sense that if you do not have local handlers, messages pass to the card and beyond.

What I am getting at is this: can you exploit the mouseDown message? If none of your buttons trap that message, and you put a handler in the card script (you have the "target" available if necessary) would that suffice to detect a "press" of any button?

Craig

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”