Page 1 of 1

Display notifications (noty)

Posted: Fri Apr 11, 2014 10:30 am
by Peter
Hello,

this snippet shows how to display notifications using noty (http://ned.im/noty/):

Code: Select all

#Window = 0
#Button = 0

Procedure OpenNoty()
  
  ! noty({ text: 'noty - a jquery notification library!', layout: 'center' });
  
EndProcedure

Procedure ScriptLoaded()
  
  DisableGadget(#Button, #False)
  
EndProcedure

Procedure LoadScript(Script.s, *OnLoadFunction)
  
  ! $.getScript(v_Script, p_OnLoadFunction);
  
EndProcedure 

OpenWindow(#Window, 0, 0, 0, 0, "noty", #PB_Window_Background)

ButtonGadget(#Button, 10, 10, 100, 30, "Open noty")
BindGadgetEvent(#Button, @OpenNoty())
DisableGadget(#Button, #True)

LoadScript("https://raw.githubusercontent.com/needim/noty/master/js/noty/packaged/jquery.noty.packaged.min.js", @ScriptLoaded())
Greetings ... Peter