summaryrefslogtreecommitdiff
path: root/areasnafu.md
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-03-16 21:52:50 -0400
committerPietro Gagliardi <[email protected]>2014-03-16 21:52:50 -0400
commit7c3647712b38e08a8f0daa970ab1a2b0857df8b0 (patch)
tree570bec783c588d9a899c87289339a1eb30a9017b /areasnafu.md
parentae554f10c3b652a3dfe765fd63107237e9aafa28 (diff)
Updated the test program to the new AreaHandler interface. The deadlock still happens... just not so easily... so it's elsewhere...
Diffstat (limited to 'areasnafu.md')
-rw-r--r--areasnafu.md17
1 files changed, 17 insertions, 0 deletions
diff --git a/areasnafu.md b/areasnafu.md
index eef08c6..807f496 100644
--- a/areasnafu.md
+++ b/areasnafu.md
@@ -86,3 +86,20 @@ type Area interface {
but I don't know how I'm going to handle the Control embed, as that uses unexported methods. The unexported methods are needed to do the acutal OS-dependent work, and I figured exporting these to the public would result in misuse.
So I'm stuck. Unless there's a way I can get either attempt working, or I can figure out some other Go-like approach... I personally felt weird about Attempt 2, but go.wde does it. I personally don't want to use a delegate type that provides the event functions and have Area require one, as that sounds both not-Go-like and more OOP-like than I want this to be. I already silently reject requests for the callback approach as it is (I should respond to them)...
+
+## Attempt 3: Delegates
+Well I did it anyway
+```
+type Area {
+ handler AreaHandler
+ // ...
+}
+type AreaHandler interface {
+ Paint(image.Rectangle) *image.NRGBA
+ Mouse(MouseEvent)
+}
+func NewArea(handler AreaHandler) *Area {
+ // ...
+}
+```
+This seems to have fixed the deadlocks!... but I can still deadlock elsewhere, so something /else/ is wrong, sigh...