Skip to content

Commit 0564be5

Browse files
committed
Fixes for tkinter and queue
1 parent 50cb6f6 commit 0564be5

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

src/stdlib/Queue.fs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ type Queue<'T>() =
2222
/// the Full exception if no free slot was available within that time. Otherwise (block is false), put an item on
2323
/// the queue if a free slot is immediately available, else raise the Full exception (timeout is ignored in that
2424
/// case).
25-
member x.put(item : 'T, ?block: bool, ?timeout: int) : unit = nativeOnly
25+
member x.put(item : 'T, ?block: bool, ?timeout: float) : unit = nativeOnly
2626
/// Remove and return an item from the queue. If optional args block is true and timeout is None (the default),
2727
/// block if necessary until an item is available. If timeout is a positive number, it blocks at most timeout
2828
/// seconds and raises the Empty exception if no item was available within that time. Otherwise (block is false),
@@ -32,7 +32,7 @@ type Queue<'T>() =
3232
/// Prior to 3.0 on POSIX systems, and for all versions on Windows, if block is true and timeout is None, this
3333
/// operation goes into an uninterruptible wait on an underlying lock. This means that no exceptions can occur, and
3434
/// in particular a SIGINT will not trigger a KeyboardInterrupt.
35-
member x.get(?block: bool, ?timeout: int) : 'T = nativeOnly
35+
member x.get(?block: bool, ?timeout: float) : 'T = nativeOnly
3636
/// Blocks until all items in the queue have been gotten and processed.
3737
///
3838
/// The count of unfinished tasks goes up whenever an item is added to the queue. The count goes down whenever a
@@ -62,7 +62,7 @@ type SimpleQueue<'T>() =
6262
/// Return True if the queue is full, False otherwise. If full() returns True it doesn’t guarantee that a subsequent
6363
/// call to get() will not block. Similarly, if full() returns False it doesn’t guarantee that a subsequent call to
6464
/// put() will not block.
65-
member x.put(item : 'T, ?block: bool, ?timeout: int) : unit = nativeOnly
65+
member x.put(item : 'T, ?block: bool, ?timeout: float) : unit = nativeOnly
6666
/// Remove and return an item from the queue. If optional args block is true and timeout is None (the default),
6767
/// block if necessary until an item is available. If timeout is a positive number, it blocks at most timeout
6868
/// seconds and raises the Empty exception if no item was available within that time. Otherwise (block is false),
@@ -72,4 +72,4 @@ type SimpleQueue<'T>() =
7272
/// Prior to 3.0 on POSIX systems, and for all versions on Windows, if block is true and timeout is None, this
7373
/// operation goes into an uninterruptible wait on an underlying lock. This means that no exceptions can occur, and
7474
/// in particular a SIGINT will not trigger a KeyboardInterrupt.
75-
member x.get(?block: bool, ?timeout: int) : 'T = nativeOnly
75+
member x.get(?block: bool, ?timeout: float) : 'T = nativeOnly

src/stdlib/TkInter.fs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,17 @@ type Tk (screenName: string option) =
3131

3232
[<Import("Frame", "tkinter")>]
3333
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)
34+
[<Import("Frame", "tkinter")>]
35+
[<Emit("$0($1, width=$2, height=$3, bg=$4)")>]
36+
new (master: Tk, width: int, height: int, bg: string) = Frame(master :> Misc)
3637

37-
member x.bind(sequence : string, func: (Event -> unit)) : string option = nativeOnly
38+
member _.bind(sequence : string, func: (Event -> unit)) : string option = nativeOnly
39+
40+
[<Import("Label", "tkinter")>]
41+
type Label (master: Misc) =
42+
[<Import("Label", "tkinter")>]
43+
[<Emit("$0($1, text=$2, fg=$3, bg=$4)")>]
44+
new (master: Tk, text: string, fg: string, bg: string) = Label(master :> Misc)
45+
46+
[<Emit("$0(x=$1, y=$2)")>]
47+
member _.place(x: int, y: int) = nativeOnly

0 commit comments

Comments
 (0)