Platforms to show: All Mac Windows Linux Cross-Platform
Required plugins for this example: MBS MacCF Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /MacCF/sysctl
This example is the version from Sun, 17th Mar 2012.
Project "sysctl.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
EventHandler Sub Open()
dim m as MemoryBlock
m=SystemControlByNameMBS("hw.model")
if m=nil then
me.text="?"
else
me.text=m.CString(0)
end if
End EventHandler
End Control
Control StaticText3 Inherits Label
ControlInstance StaticText3 Inherits Label
End Control
Control StaticText4 Inherits Label
ControlInstance StaticText4 Inherits Label
EventHandler Sub Open()
dim m as MemoryBlock
dim name as MemoryBlock
const KERN_VERSION = 4
const CTL_KERN = 1
name=NewMemoryBlock(8)
name.Long(0)=CTL_KERN
name.Long(4)=KERN_VERSION
m=SystemControlMBS(name)
if m=nil then
me.text="?"
else
me.text=m.CString(0)
end if
End EventHandler
End Control
Control StaticText5 Inherits Label
ControlInstance StaticText5 Inherits Label
End Control
Control StaticText6 Inherits Label
ControlInstance StaticText6 Inherits Label
EventHandler Sub Open()
dim name,m as MemoryBlock
const CTL_HW = 6
const HW_BUS_FREQ = 14
name=NewMemoryBlock(8)
name.Long(0)=CTL_HW
name.Long(4)=HW_BUS_FREQ
m=SystemControlMBS(name)
if m=nil then
me.text="?"
else
me.text=Format(m.Long(0),"0")+" Hz"
end if
End EventHandler
End Control
Control StaticText7 Inherits Label
ControlInstance StaticText7 Inherits Label
End Control
Control StaticText8 Inherits Label
ControlInstance StaticText8 Inherits Label
EventHandler Sub Open()
dim name,m as MemoryBlock
name=SystemControlNameToMIBMBS("hw.machine")
m=SystemControlMBS(name)
if m=nil then
me.text="?"
else
me.text=m.CString(0)
end if
End EventHandler
End Control
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
The items on this page are in the following plugins: MBS MacCF Plugin.