Separated initial text from sysData.make() on the Mac OS X backend, completing that set of commits.
This commit is contained in:
parent
7a079f1cbb
commit
2efda7bc39
|
@ -178,7 +178,6 @@ var classTypes = [nctypes]*classData{
|
||||||
},
|
},
|
||||||
show: controlShow,
|
show: controlShow,
|
||||||
hide: controlHide,
|
hide: controlHide,
|
||||||
// TODO setText
|
|
||||||
textsel: _titleOfSelectedItem,
|
textsel: _titleOfSelectedItem,
|
||||||
alttextsel: _stringValue,
|
alttextsel: _stringValue,
|
||||||
append: func(id C.id, what string, alternate bool) {
|
append: func(id C.id, what string, alternate bool) {
|
||||||
|
@ -301,7 +300,7 @@ func getSysData(key C.id) *sysData {
|
||||||
return v
|
return v
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *sysData) make(initText string, window *sysData) error {
|
func (s *sysData) make(window *sysData) error {
|
||||||
var parentWindow C.id
|
var parentWindow C.id
|
||||||
|
|
||||||
ct := classTypes[s.ctype]
|
ct := classTypes[s.ctype]
|
||||||
|
@ -314,7 +313,6 @@ func (s *sysData) make(initText string, window *sysData) error {
|
||||||
ret <- ct.make(parentWindow, s.alternate)
|
ret <- ct.make(parentWindow, s.alternate)
|
||||||
}
|
}
|
||||||
s.id = <-ret
|
s.id = <-ret
|
||||||
s.setText(initText)
|
|
||||||
if ct.getinside != nil {
|
if ct.getinside != nil {
|
||||||
uitask <- func() {
|
uitask <- func() {
|
||||||
ret <- ct.getinside(s.id)
|
ret <- ct.getinside(s.id)
|
||||||
|
@ -353,11 +351,6 @@ func (s *sysData) hide() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *sysData) setText(text string) {
|
func (s *sysData) setText(text string) {
|
||||||
var zeroSel C.SEL
|
|
||||||
|
|
||||||
if classTypes[s.ctype].settextsel == zeroSel { // does not have concept of text
|
|
||||||
return
|
|
||||||
}
|
|
||||||
ret := make(chan struct{})
|
ret := make(chan struct{})
|
||||||
defer close(ret)
|
defer close(ret)
|
||||||
uitask <- func() {
|
uitask <- func() {
|
||||||
|
|
1
todo.md
1
todo.md
|
@ -18,7 +18,6 @@ so I don't forget:
|
||||||
- should message box text be selectable on all platforms or only on those that make it the default?
|
- should message box text be selectable on all platforms or only on those that make it the default?
|
||||||
- Listbox/Combobox.Index(n)
|
- Listbox/Combobox.Index(n)
|
||||||
- Index(n) is the name used by reflect.Value; use a different one?
|
- Index(n) is the name used by reflect.Value; use a different one?
|
||||||
- change sysData.make() so it does not take the initial window text as an argument and instead have the respective Control/Window.make() call sysData.setText() expressly; this would allow me to remove the "no such concept of text" checks from the GTK+ and Mac OS X backends
|
|
||||||
- Message boxes should not show secondary text if none is specified.
|
- Message boxes should not show secondary text if none is specified.
|
||||||
- note that you can change event channels before opening the window; this allows unifying menus/toolbars/etc.
|
- note that you can change event channels before opening the window; this allows unifying menus/toolbars/etc.
|
||||||
- will probably want to bring back Event() for this (but as NewEvent())
|
- will probably want to bring back Event() for this (but as NewEvent())
|
||||||
|
|
Loading…
Reference in New Issue