MakieLayout.jl icon indicating copy to clipboard operation
MakieLayout.jl copied to clipboard

Textbox observable widget?

Open Datseris opened this issue 4 years ago • 7 comments

Hi there, the current interactive widges you guys have are amazing. I am preparing a totally mindblowing interactive application.

In parallel, I also want to port InteractiveChaos here and drop Blink dependencies and usage.

There is only one thing necessary for me to be able to do that: a textbox widget where the observable is the text the user writes, or that the text is updated as an observable via mechanisms during the animation.

Do you think it is possible to implement this here?

Datseris avatar Apr 15 '20 19:04 Datseris

It's certainly possible, but hard. We'd need to think about the UI before really implementing it.

Could you give a summary of features you need? It is certainly possible to write a text handler from the keyboard primitives, but it would need to be pretty heavily optimized.

asinghvi17 avatar Apr 19 '20 07:04 asinghvi17

I use the textbox of Interact.jl so far, and its features are the features I need. I need a textbox whose text is an observable and the following can occur:

  • Running my application and updating the observable also updates the visible text
  • Deleting the visible text and writing a new text updates the observable and I can use the updated text in the simulation.

Datseris avatar Apr 19 '20 08:04 Datseris

With the pending text changes, at least multiline text will actually work. Then the first part will already be covered by LText, the second part will require coding the "interactive" part

jkrumbiegel avatar Apr 19 '20 16:04 jkrumbiegel

I've implemented this multiple times, and it always got lost in the numerous text refactors :D It's not too hard, but a bit finicky here and there ;)

SimonDanisch avatar Apr 19 '20 16:04 SimonDanisch

It mainly relies on having a stable mouseposition -> index in character array... Which maybe a lot easier to implement with our new text + boundingbox etc api ;)

SimonDanisch avatar Apr 19 '20 16:04 SimonDanisch

Just wanted to ask whether there has been any progress on this? I'm also looking to develop a Interact-type GUI within the Makie framework and having a way to input text is important for such an application.

grero avatar Jul 07 '20 08:07 grero

I didn't continue working on the textbox, but it was relatively usable at the end. I think I stopped after a while because some features one expects textboxes to have are very finicky, plus they would be a bit easier to implement with some changes to the text pipeline that haven't yet been merged. You could look at the textbox branch, copy that code and play with it a bit to see if it's useful to you in its current state

jkrumbiegel avatar Jul 08 '20 06:07 jkrumbiegel