Draft: draft of listbox
checked against:
- initial commit
- future patches in git
- current state of the files in the repo
The way this is supposed to work:
- if user double-clicks a listbox, Pd Vanilla triggers the rtext_key bullshit to allow text edition while in runmode. However, in Purr we just intercept rtext_activate in a contentEditable div (vis a vis new_object_textentry) and let the GUI handle all text edition
- when single-clicking a float or symbol atom, same behavior
- when the user is finished editing junk in the listbox, we send it to the backend, use canvas_buftotext to update the buffer, then send a mouse event to trigger the gatom_retext call inside canvas_doclick
current issues:
-
the text typed into a listbox isn't getting displayed properly. We're getting the text from GUI -> canvas_buftotext -> canvas_doclick ok. But in line 3772 of g_editor.c we're calling gatom_key, which in turns calls rtext_activate with a value of zero. When that happens, the gl_editor gets its e_textedfor member set to zero, and that causes us to fail the condition in 3829 of g_editor.c where we're supposed to call rtext_retext. We could just move that call to canvas_buftotext, but given this nasty, sprawling patch for such a finicky widget I'm much rather stay as close as we can to Pd Vanilla. -
listbox, float atom, and symbol atom all have bogus initialization values when you create them from the "Put" menu (to test listbox, do File -> Message and add the word "listbox" after the highlighted canvas ID) -
probably need slightly different GUI behavior for the runmode listbox/atom text mode. E.g., on we want to trigger the new value