Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
29
Task/Read-entire-file/FutureBasic/read-entire-file.basic
Normal file
29
Task/Read-entire-file/FutureBasic/read-entire-file.basic
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
_window = 1
|
||||
begin enum 1
|
||||
_scrollView
|
||||
_textView
|
||||
end enum
|
||||
|
||||
void local fn BuildWindow
|
||||
CGRect r = {0,0,550,400}
|
||||
window _window, @"Read Entire File", r
|
||||
scrollview _scrollView, r
|
||||
ViewSetAutoresizingMask( _scrollView, NSViewWidthSizable + NSViewHeightSizable )
|
||||
textview _textView,, _scrollView
|
||||
end fn
|
||||
|
||||
local fn ReadTextFile
|
||||
CFStringRef string
|
||||
CFURLRef url = openpanel 1, @"Select text file..."
|
||||
if ( url )
|
||||
string = fn StringWithContentsOfURL( url, NSUTF8StringEncoding, NULL )
|
||||
TextSetString( _textView, string )
|
||||
else
|
||||
// user cancelled
|
||||
end if
|
||||
end fn
|
||||
|
||||
fn BuildWindow
|
||||
fn ReadTextFile
|
||||
|
||||
HandleEvents
|
||||
Loading…
Add table
Add a link
Reference in a new issue