diff --git a/redo/area_unix.go b/redo/area_unix.go index ed52beb..ae64c83 100644 --- a/redo/area_unix.go +++ b/redo/area_unix.go @@ -85,7 +85,7 @@ func newArea(ab *areabase) Area { area_textfield_focus_out_event_callback, C.gpointer(unsafe.Pointer(a))) // the widget shows up initially - C.gtk_widget_hide(a.textfieldw) + C.gtk_widget_set_no_show_all(a.textfieldw, C.TRUE) return a } @@ -115,6 +115,8 @@ func (a *area) OpenTextFieldAt(x, y int) { a.textfieldx = x a.textfieldy = y a.SetTextFieldText("") + // we disabled this for the initial Area show; we don't need to anymore + C.gtk_widget_set_no_show_all(a.textfieldw, C.FALSE) C.gtk_widget_show_all(a.textfieldw) C.gtk_widget_grab_focus(a.textfieldw) } @@ -152,6 +154,7 @@ var area_get_child_position_callback = C.GCallback(C.our_area_get_child_position func our_area_textfield_focus_out_event_callback(widget *C.GtkWidget, event *C.GdkEvent, data C.gpointer) C.gboolean { a := (*area)(unsafe.Pointer(data)) C.gtk_widget_hide(a.textfieldw) + a.textfielddone.fire() return continueEventChain } diff --git a/redo/yz_repaint_test.go b/redo/yz_repaint_test.go index 5783bac..1c8eb55 100644 --- a/redo/yz_repaint_test.go +++ b/redo/yz_repaint_test.go @@ -30,6 +30,7 @@ func newRepainter(times int) *repainter { r := new(repainter) r.img = tileImage(times) r.area = NewArea(r.img.Rect.Dx(), r.img.Rect.Dy(), r) + r.area.OnTextFieldDismissed(r.tfdone) r.x = NewTextField() r.x.OnChanged(r.setx) r.y = NewTextField()