Platforms to show: All Mac Windows Linux Cross-Platform
/MacControls/Textarea Transparency
Required plugins for this example: MBS MacCocoa Plugin, MBS MacBase Plugin, MBS Main Plugin, MBS MacControls Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /MacControls/Textarea Transparency
This example is the version from Thu, 5th Sep 2018.
Project "Textarea Transparency.xojo_binary_project"
Class App Inherits Application
Const kEditClear = "&Delete"
Const kFileQuit = "&Quit"
Const kFileQuitShortcut = ""
End Class
Class MainWindow Inherits Window
Control Rectangle1 Inherits Rectangle
ControlInstance Rectangle1 Inherits Rectangle
End Control
Control PushButton1 Inherits PushButton
ControlInstance PushButton1 Inherits PushButton
EventHandler Sub Action()
// for Mac turn background invisible
dim n as NSTextViewMBS = TextArea1.NSTextViewMBS
n.drawsBackground = true
n.backgroundColor = NSColorMBS.whiteColor
dim s as NSScrollViewMBS = TextArea1.NSScrollViewMBS
s.drawsBackground = true
s.backgroundColor = NSColorMBS.whiteColor
s.setBackgroundFilters nil
End EventHandler
End Control
Control TextArea1 Inherits TextArea
ControlInstance TextArea1 Inherits TextArea
End Control
Control PushButton2 Inherits PushButton
ControlInstance PushButton2 Inherits PushButton
EventHandler Sub Action()
// for Mac turn background invisible
dim n as NSTextViewMBS = TextArea1.NSTextViewMBS
n.drawsBackground = false
n.backgroundColor = NSColorMBS.clearColor
dim s as NSScrollViewMBS = TextArea1.NSScrollViewMBS
s.drawsBackground = false
s.backgroundColor = NSColorMBS.clearColor
s.setBackgroundFilters nil
End EventHandler
End Control
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
End Project
See also:
The items on this page are in the following plugins: MBS MacControls Plugin.