Skip to content

Commit 34f2c88

Browse files
committed
Fixes for tkinter
1 parent 479da00 commit 34f2c88

File tree

3 files changed

+30
-9
lines changed

3 files changed

+30
-9
lines changed

Build.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Target.create "Test" (fun _ ->
3838
)
3939

4040
Target.create "Pack" (fun _ ->
41-
run dotnet "pack" srcPath
41+
run dotnet "pack -c Release" srcPath
4242
)
4343

4444
Target.create "Format" (fun _ ->

src/Fable.Python.fsproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<Author>Dag Brattli</Author>
77
<Copyright>Dag Brattli</Copyright>
88
<PackageLicenseFile>LICENSE</PackageLicenseFile>
9-
<Version>0.3.0</Version>
9+
<Version>0.4.0</Version>
1010
<WarnOn>3390;$(WarnOn)</WarnOn>
1111
</PropertyGroup>
1212
<ItemGroup>

src/stdlib/TkInter.fs

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,36 @@ module Fable.Python.TkInter
22

33
open Fable.Core
44

5+
type Event =
6+
abstract member x: int
7+
abstract member y: int
8+
59
type Misc =
6-
abstract member title : string with get, set
10+
abstract member bind : sequence : string * func: (Event -> unit) -> string option
711

8-
[<Import("Frame", "tkinter")>]
9-
type Frame(master: Misc) =
10-
do ()
12+
type Wm =
13+
abstract member title : unit -> string
14+
abstract member title : ``string``: string -> unit
1115

1216
[<Import("Tk", "tkinter")>]
13-
type Tk (name: string) =
17+
type Tk (screenName: string option) =
18+
interface Wm with
19+
member _.title(``string``: string) = nativeOnly
20+
member _.title() = nativeOnly
21+
1422
interface Misc with
15-
member _.title: string = nativeOnly
16-
member _.title with set (value: string) = nativeOnly
23+
member _.bind(sequence : string, func: (Event -> unit)) = nativeOnly
24+
25+
new () = Tk (None)
26+
27+
member _.title(``string``: string) = nativeOnly
28+
member _.title() = nativeOnly
29+
30+
member _.update() = nativeOnly
31+
32+
[<Import("Frame", "tkinter")>]
33+
type Frame(master: Misc) =
34+
[<Emit("Frame($0, width=$1, height=$2, bg=$3)")>]
35+
new (root: Tk, width: int, height: int, bg: string) = Frame(root :> Misc)
36+
37+
member x.bind(sequence : string, func: (Event -> unit)) : string option = nativeOnly

0 commit comments

Comments
 (0)