Xojo Conferences
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

/Util/SignalHandler/SignalHandler
Function:
Required plugins for this example: MBS Util Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /Util/SignalHandler/SignalHandler
This example is the version from Sun, 17th Mar 2012.
Project "SignalHandler.rbp"
Class App Inherits Application
Const kEditClear = "&Delete"
Const kFileQuit = "&Quit"
Const kFileQuitShortcut = ""
EventHandler Sub Open() if Targetmacho then // ok elseif TargetLinux then // ok else MsgBox "This example is only for Unix." end if End EventHandler
End Class
Class Window1 Inherits Window
Const SIGALRM = 14
Control PushButton1 Inherits PushButton
ControlInstance PushButton1 Inherits PushButton
EventHandler Sub Action() SignalHandlerMBS.alarm 1 End EventHandler
End Control
Control PushButton2 Inherits PushButton
ControlInstance PushButton2 Inherits PushButton
EventHandler Sub Action() if SignalHandlerMBS.SetDefaultHandler(SIGALRM) then MsgBox "Done" else MsgBox "Failed" end if End EventHandler
End Control
Control PushButton3 Inherits PushButton
ControlInstance PushButton3 Inherits PushButton
EventHandler Sub Action() if SignalHandlerMBS.SetIgnore(SIGALRM) then MsgBox "Done" else MsgBox "Failed" end if End EventHandler
End Control
Control PushButton4 Inherits PushButton
ControlInstance PushButton4 Inherits PushButton
EventHandler Sub Action() if s.SetEventHandler(SIGALRM) then MsgBox "Done" else MsgBox "Failed" end if End EventHandler
End Control
EventHandler Sub Open() s=new MySignalHandler End EventHandler
Property s As mysignalHandler
End Class
MenuBar MenuBar1
MenuItem FileMenu = "&File"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Edit"
MenuItem EditUndo = "&Undo"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "Cu&t"
MenuItem EditCopy = "&Copy"
MenuItem EditPaste = "&Paste"
MenuItem EditClear = "#App.kEditClear"
MenuItem UntitledMenu0 = "-"
MenuItem EditSelectAll = "Select &All"
End MenuBar
Class MySignalHandler Inherits SignalHandlerMBS
EventHandler Sub Signal(n as integer) System.DebugLog "Signal "+str(n) End EventHandler
End Class
End Project

Feedback, Comments & Corrections

The items on this page are in the following plugins: MBS Util Plugin.




Links
MBS Xojo Chart Plugins