initialise app with a file path, for the functionality of loading different files from the terminal

This commit is contained in:
2025-08-26 15:56:52 +01:00
parent a98ca50cf5
commit dcd3c3117e
5 changed files with 36 additions and 14 deletions

View File

@@ -1,6 +1,7 @@
signature APP_INIT =
sig
val fromWindowWidthAndHeight: int * int * int * int -> AppType.app_type
val fromWindowWidthAndHeight: int * int * int * int * string
-> AppType.app_type
end
structure AppInit :> APP_INIT =
@@ -16,6 +17,7 @@ struct
, hFinish
, canvasWidth
, canvasHeight
, filepath
) : app_type =
let
val (xClickPoints, yClickPoints) =
@@ -38,7 +40,7 @@ struct
, showGraph = true
, arrowX = 0
, arrowY = 0
, openFilePath = ""
, openFilePath = filepath
, r = 0
, g = 0
, b = 0
@@ -50,7 +52,7 @@ struct
end
fun fromWindowWidthAndHeight
(windowWidth, windowHeight, canvasWidth, canvasHeight) =
(windowWidth, windowHeight, canvasWidth, canvasHeight, filepath) =
if windowWidth > windowHeight then
let
val difference = windowWidth - windowHeight
@@ -66,6 +68,7 @@ struct
, windowHeight
, canvasWidth
, canvasHeight
, filepath
)
end
else
@@ -83,6 +86,7 @@ struct
, hFinish
, canvasWidth
, canvasHeight
, filepath
)
end
end