From d13e398e903219ec622293e18384fa2a0207768a Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Sat, 28 Jun 2014 01:22:40 -0400 Subject: Migrated window.go and sysdata.go to the new API. Controls will need to be migrated as well. --- sysdata.go | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) (limited to 'sysdata.go') diff --git a/sysdata.go b/sysdata.go index 4a95591..14bfc20 100644 --- a/sysdata.go +++ b/sysdata.go @@ -2,21 +2,15 @@ package ui -const eventbufsiz = 100 // suggested by skelterjohn - -// newEvent returns a new channel suitable for listening for events. -func newEvent() chan struct{} { - return make(chan struct{}, eventbufsiz) -} - // The sysData type contains all system data. It provides the system-specific underlying implementation. It is guaranteed to have the following by embedding: type cSysData struct { ctype int - event chan struct{} allocate func(x int, y int, width int, height int, d *sysSizeData) []*allocation spaced bool alternate bool // editable for Combobox, multi-select for listbox, password for lineedit - handler AreaHandler // for Areas + handler AreaHandler // for Areas; TODO rename to areahandler + winhandler WindowHandler // for Windows + event func() // provided by each widget } // this interface is used to make sure all sysDatas are synced @@ -44,19 +38,6 @@ var _xSysData interface { setChecked(bool) } = &sysData{} // this line will error if there's an inconsistency -// signal sends the event signal. This raise is done asynchronously to avoid deadlocking the UI task. -// Thanks skelterjohn for this techinque: if we can't queue any more events, drop them -func (s *cSysData) signal() { - if s.event != nil { - go func() { - select { - case s.event <- struct{}{}: - default: - } - }() - } -} - const ( c_window = iota c_button -- cgit v1.2.3