Platforms to show: All Mac Windows Linux Cross-Platform
Required plugins for this example: MBS MacClassic Plugin, MBS Picture Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /MacClassic/Unmount disk
This example is the version from Sun, 5th Nov 2022.
Project "Unmount disk.xojo_binary_project"
Class Fenster1 Inherits Window
Control PushButton1 Inherits PushButton
ControlInstance PushButton1 Inherits PushButton
EventHandler Sub Action()
nextvolume
End EventHandler
End Control
Control volumeicon Inherits Canvas
ControlInstance volumeicon Inherits Canvas
End Control
Control volumename Inherits Label
ControlInstance volumename Inherits Label
End Control
Control PushButton4 Inherits PushButton
ControlInstance PushButton4 Inherits PushButton
EventHandler Sub Action()
if current.UnMountVolumeMBS=0 then
msgBox "Volume ejected."
current=nil
nextvolume
else
msgBox "There was an error!"
end if
End EventHandler
EventHandler Sub Open()
me.enabled=targetMacOS
End EventHandler
End Control
EventHandler Sub Open()
nextvolume
End EventHandler
Sub SetCurrent(c as FolderItem)
current = c
volumeicon.Backdrop = c.IconMBS(volumeicon.Width)
End Sub
Sub nextvolume()
dim i as integer
dim c as integer
dim last as folderItem
if current<>nil then
last=current
current=nil
c=volumeCount-1
for i=0 to c
if volume(i).GetVolumeRefMBS = last.GetVolumeRefMBS then // macvRefNum is a good compare for Volumes on Mac OS but doesn't work on Windows.
if i<c then
SetCurrent volume(i+1)
exit
end if
end if
next
end if
if current=nil then
SetCurrent volume(0)
end if
volumename.text=current.displayName
volumeicon.refresh
End Sub
Property current As folderItem
End Class
MenuBar Menü
MenuItem UntitledMenu3 = ""
MenuItem UntitledMenu2 = "Ablage"
MenuItem FileQuit = "Beenden"
MenuItem UntitledMenu7 = ""
MenuItem UntitledMenu0 = "Bearbeiten"
MenuItem EditUndo = "Undo"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "Ausschneiden"
MenuItem EditCopy = "Kopieren"
MenuItem EditPaste = "Einfügen"
MenuItem EditClear = "Löschen"
MenuItem UntitledMenu6 = ""
MenuItem UntitledMenu5 = ""
MenuItem UntitledMenu4 = ""
End MenuBar
Class App Inherits Application
End Class
End Project
The items on this page are in the following plugins: MBS MacClassic Plugin.