Platforms to show: All Mac Windows Linux Cross-Platform
Required plugins for this example: MBS Mac64bit Plugin, MBS Main Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /Mac64bit/Accounts
This example is the version from Fri, 3rd Mar 2022.
Project "Accounts.xojo_binary_project"
Class App Inherits Application
Const kEditClear = "&Delete"
Const kFileQuit = "&Quit"
Const kFileQuitShortcut = ""
End Class
Class MainWindow Inherits Window
Control List Inherits Listbox
ControlInstance List Inherits Listbox
End Control
EventHandler Sub Open()
#if TargetMacOS and Target64Bit then
AccountStore = new myACAccountStoreMBS
dim TwitterType as ACAccountTypeMBS = AccountStore.accountTypeWithAccountTypeIdentifier(ACAccountTypeMBS.ACAccountTypeIdentifierTwitter)
if TwitterType = nil then
break
else
// ask...
AccountStore.requestAccessToAccountsWithType TwitterType, nil
end if
// show what we have.
update
#else
MsgBox "This example is for Xojo 2015r3 with 64-bit app."
#endif
End EventHandler
Sub update()
list.DeleteAllRows
dim accounts() as ACAccountMBS = AccountStore.accounts
for each account as ACAccountMBS in accounts
List.AddRow account.identifier, account.accountType.accountTypeDescription, account.username, account.accountDescription
List.RowTag(List.LastIndex) = account
next
End Sub
Note "Plugins"
to run this example, you need this plugins
MBS Mac64bit Plugin
MBS Main Plugin
MBS MacCloud Plugin
MBS MacBase Plugin
MBS MacCocoa Plugin
MBS MacControls Plugin
MBS MacCG Plugin
MBS MacCF Plugin
and Xojo 2015r3
Property AccountStore As myACAccountStoreMBS
End Class
MenuBar MainMenuBar
MenuItem FileMenu = "&File"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Edit"
MenuItem EditUndo = "&Undo"
MenuItem EditSeparator1 = "-"
MenuItem EditCut = "Cu&t"
MenuItem EditCopy = "&Copy"
MenuItem EditPaste = "&Paste"
MenuItem EditClear = "#App.kEditClear"
MenuItem EditSeparator2 = "-"
MenuItem EditSelectAll = "Select &All"
End MenuBar
Class myACAccountStoreMBS Inherits ACAccountStoreMBS
EventHandler Sub Changed()
MainWindow.update
End EventHandler
EventHandler Sub requestAccessCompleted(granted as boolean, error as NSErrorMBS, accountType as ACAccountTypeMBS, tag as variant)
MainWindow.update
End EventHandler
End Class
End Project
The items on this page are in the following plugins: MBS Mac64bit Plugin.