Resume and suspend messages and controls

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
ibe
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 61
Joined: Sun Oct 04, 2009 12:15 pm

Resume and suspend messages and controls

Post by ibe » Sun Jun 26, 2011 5:38 pm

I am making an iCal type calendar widget and came across an issue that I can't seem to resolve. The calendar control should change it's outlook depending on whether the stack it is in is the active window or not. I can trap these messages at card level by having handlers for 'resume', 'resumeStack', 'suspend', and 'suspendStack' and then calling the control to change it's appearance.

However, I want to make this widget independent so it can be copied to new stacks and they would not need any extraneous code added to them. Anyone have ideas on how this can be done. Obviously it's possible as there are third party controls out there that do exactly this.

All answers appreciated,

ibe

shaosean
Posts: 906
Joined: Thu Nov 04, 2010 7:53 am

Re: Resume and suspend messages and controls

Post by shaosean » Sun Jun 26, 2011 6:48 pm

Setting the backgroundBehavior of the control's group to true allows it to get the suspend/resume messages.. Otherwise point out a third party control that does it and lets see if we can figure it out..

ibe
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 61
Joined: Sun Oct 04, 2009 12:15 pm

Re: Resume and suspend messages and controls

Post by ibe » Sun Jun 26, 2011 7:20 pm

Sorry Shao, backgroundBeahvior isn't the answer as then the control would be on every window and that won't work for me. I know Steve has solved this problem with the Data Tree.

shaosean
Posts: 906
Joined: Thu Nov 04, 2010 7:53 am

Re: Resume and suspend messages and controls

Post by shaosean » Mon Jun 27, 2011 1:47 am

Does the data tree have a library stack or any front/back scripts?

ibe
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 61
Joined: Sun Oct 04, 2009 12:15 pm

Re: Resume and suspend messages and controls

Post by ibe » Mon Jun 27, 2011 1:19 pm

Yes. That is the answer. I'll just make it into a library stack and use front scripts to handle the calendar.

Post Reply