Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitedd0daf

Browse files
committed
Workaround problem with "fsharpi --gui" on mac
fsharp#40
1 parent50c8fa3 commitedd0daf

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

‎src/fsharp/fsi/fsi.fs‎

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1959,6 +1959,10 @@ type FsiInteractionProcessor(tcConfigB,
19591959
typeDummyForm()=
19601960
inherit Form()
19611961
memberx.DoCreateHandle()= x.CreateHandle()
1962+
/// Creating the dummy form object can crash on Mono Mac, and then prints a nasty background
1963+
/// error during finalization of the half-initialized object...
1964+
overridex.Finalize()=()
1965+
19621966

19631967
/// This is the event loop implementation for winforms
19641968
typeWinFormsEventLoop(fsiConsoleOutput: FsiConsoleOutput,lcid: int option)=
@@ -2460,8 +2464,14 @@ type internal FsiEvaluationSession (argv:string[], inReader:TextReader, outWrite
24602464
();
24612465

24622466
// This is the event loop for winforms
2463-
fsi.EventLoop<- WinFormsEventLoop(fsiConsoleOutput, fsiOptions.FsiLCID)
2464-
2467+
try fsi.EventLoop<- WinFormsEventLoop(fsiConsoleOutput, fsiOptions.FsiLCID)
2468+
with e->
2469+
printfn"Your system doesn't seem to support WinForms correctly. You will"
2470+
printfn"need to set fsi.EventLoop use GUI windows from F# Interactive."
2471+
printfn"You can set different event loops for MonoMac, Gtk#, WinForms and other"
2472+
printfn"UI toolkits. Drop the --gui argument if no event loop is required.""
2473+
2474+
24652475
istateRef := fsiInteractionProcessor.LoadInitialFiles (exitViaKillThread, !istateRef)
24662476
24672477
StartStdinReadAndProcessThread(fsiOptions.FsiLCID, istateRef, errorLogger, fsiConsoleInput, fsiConsoleOutput, fsiStdinLexerProvider, fsiInteractionProcessor, exitViaKillThread)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp