Platforms to show: All Mac Windows Linux Cross-Platform
/Util/softDeclares/Softdeclare Linux
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/softDeclares/Softdeclare Linux
This example is the version from Sun, 17th Mar 2012.
Project "Softdeclare Linux.xojo_binary_project"
FileTypes
Filetype text
End FileTypes
Class Window1 Inherits Window
Control StaticText1 Inherits Label
ControlInstance StaticText1 Inherits Label
End Control
Control StaticText2 Inherits Label
ControlInstance StaticText2 Inherits Label
End Control
Control StaticText3 Inherits Label
ControlInstance StaticText3 Inherits Label
End Control
EventHandler Sub Open()
dim s as SoftDeclareMBS
dim m as MemoryBlock
s=new SoftDeclareMBS
if s.LoadLibrary("/lib/libm.so.6") then
if s.LoadFunction("cos") then
m=NewMemoryBlock(8)
m.DoubleValue(0)=2.0
// one double = two longs...
if s.CallFunctionDouble(2,m) then
StaticText2.text=str(s.ResultDouble)
else
StaticText3.text="Failed to run function."
end if
else
StaticText3.text="Failed to load function."
end if
else
StaticText3.text="Failed to load library."
end if
if not TargetLinux then
MsgBox "only for Linux."
end if
End EventHandler
End Class
MenuBar MenuBar1
MenuItem UntitledMenu1 = ""
MenuItem FileMenu = "&File"
MenuItem FileQuit = "Quit"
MenuItem EditMenu = "&Edit"
MenuItem EditUndo = "&Undo"
MenuItem UntitledMenu0 = "-"
MenuItem EditCut = "Cu&t"
MenuItem EditCopy = "&Copy"
MenuItem EditPaste = "&Paste"
MenuItem EditClear = "Clear"
End MenuBar
Class App Inherits Application
End Class
End Project
See also:
The items on this page are in the following plugins: MBS Util Plugin.