Notification system

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
giovanni_c
Posts: 52
Joined: Sat Sep 08, 2012 10:50 am

Notification system

Post by giovanni_c » Thu May 21, 2015 9:22 am

Hi all.
I'm trying to create a basic notification system to show to the user a notification stack when he receives a new information.
Basicly when the notification arrives I show a stack with the notification text and a close button. The system can be configured to autohide the notification after few seconds.

I've a little problem in doing this. Infact when the notification stack is showed the stack in which i'm workin' on lose the focus... When notification stack hides the focus return on the previous stack.
So my question is: there is a way to manage the showing of a stack without lose the focus on the actual main stack? I've tried to set the notification stack as modeless without success. The notification stack has the systemWindow property set to true but even if I set this property to false nothing changes.
Hope someone can point me to the right direction!
Thank you in advance.

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am
Location: Palo Alto

Re: Notification system

Post by Simon » Thu May 21, 2015 5:59 pm

Hi giovanni_c,
Not sure this helps but when the notification stack shows up you can "go to stack "myWorkingStack"" but this will hide you notification stack if it's on top of your myWorkingStack.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

hliljegren
Posts: 108
Joined: Sun Aug 23, 2009 7:48 am
Contact:

Re: Notification system

Post by hliljegren » Fri May 22, 2015 7:49 am

I think you can use the focusedObject

Before you open the notification stack you can save the current focusedObject

put the focusedObject into tObjectToReturnTo

and then open the notification stack and finally set the focus back via:

focus tObjectToReturnTo

:-Håkan
___________________________________
MacBook Pro, 15" 2.6GHz i7 Mac OS X 10.10.4
iMac 27", 3.2 GHz Quad i7, Mac OS 10.10.4
LiveCode 7.0.6 or 8.0dp4

giovanni_c
Posts: 52
Joined: Sat Sep 08, 2012 10:50 am

Re: Notification system

Post by giovanni_c » Fri May 22, 2015 8:28 am

Hi all. Thank you for your replies!
I've tried both your suggestions and both work well enough (in any case I've a little "flash" but i think it's acceptable). Thank you!

I prefer the first solution (go to stack ...) because mantains correctly the focus on a field if i'm writing something while the notification appears. I've set the systemWindows of notification stack to true so the stack is always on top of the others.

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7227
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Notification system

Post by jacque » Fri May 22, 2015 5:30 pm

A system window will float over other apps too and will always be visible everywhere on the computer. If you only want it to be visible within your own app, set it up as a palette. That may solve your focus problem too.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply

Return to “Talking LiveCode”