0
$\begingroup$

I'm curious whether if there is a method of creating InputFields that are similar to this:enter image description here

I am currently attempting to create a crossword puzzle that has an interface like this, and I found it difficult to have those simple clickable inputs in Mathematica (The input fields often require a double click which is kinda annoying, also there is spacing between the fields so it doesn't look nice.

I tried browsing around the forum but failed to find any answers, so it would be very appreciated if someone could help me with this issue as I am still rather new to Mathematica and don't know a lot of the functionality, thanks in advance.

Edit: The string that I am trying to put into the input grid is like this:

 {{1, 1, " "}, {2, 1, "e"}, {3, 1, "n"}, {4, 1, "d"}, {5, 1, "i"}, {6, 
   1, "n"}, {7, 1, "g"}, {8, 1, "c"}, {1, 2, " "}, {2, 2, " "}, {3, 2,
    " "}, {4, 2, "e"}, {5, 2, " "}, {6, 2, "b"}, {7, 2, " "}, {8, 2, 
   "h"}, {1, 3, " "}, {2, 3, "a"}, {3, 3, " "}, {4, 3, "s"}, {5, 3, 
   " "}, {6, 3, "a"}, {7, 3, " "}, {8, 3, "i"}, {1, 4, " "}, {2, 4, 
   "p"}, {3, 4, " "}, {4, 4, "t"}, {5, 4, " "}, {6, 4, "n"}, {7, 4, 
   " "}, {8, 4, "c"}, {1, 5, " "}, {2, 5, "p"}, {3, 5, " "}, {4, 5, 
   "r"}, {5, 5, " "}, {6, 5, "a"}, {7, 5, " "}, {8, 5, "k"}, {1, 6, 
   " "}, {2, 6, "l"}, {3, 6, " "}, {4, 6, "o"}, {5, 6, " "}, {6, 6, 
   "n"}, {7, 6, " "}, {8, 6, "e"}, {1, 7, " "}, {2, 7, "e"}, {3, 7, 
   " "}, {4, 7, "y"}, {5, 7, " "}, {6, 7, "a"}, {7, 7, " "}, {8, 7, 
   "n"}, {1, 8, "a"}, {2, 8, "b"}, {3, 8, "a"}, {4, 8, "s"}, {5, 8, 
   "h"}, {6, 8, " "}, {7, 8, " "}, {8, 8, " "}}}

Whereas the will be black spaces on the parts where it is a " ", Also is there a way to create a special label on the parts where the words start? I have a list of the blocks where the words start, but how do I combine them together? Sorry for the inconvenience.

{{4, 1, 0, "destroy"}, {8, 1, 0, "chicken"}, {2, 1, 1, "ending"}, {6, 
  2, 0, "banana"}, {1, 8, 1, "abash"}, {2, 3, 0, "apple"}} 

This is the list where I have the starting coordinates

$\endgroup$
  • 3
    $\begingroup$ Like: x = ConstantArray["", {5, 5}]; Table[With[{i = i, j = j}, InputField[Dynamic[x[[i, j]], ((x[[i, j]] = StringTake[#, -1]) &)], String, ImageSize -> {25, 25}, Alignment -> {Center, Center}, ImageMargins -> 0, Appearance -> None, ContinuousAction -> True] ], {i, 5}, {j, 5}] // Grid[#, Spacings -> {0, 0}, Frame -> All] &? $\endgroup$ – Kuba Mar 18 '18 at 11:20
  • $\begingroup$ But if you want a clear answer they you should provide more details about expected output. What events should be handled, how to navigate between fields, how are non editable firelds determined etc $\endgroup$ – Kuba Mar 18 '18 at 11:24
  • $\begingroup$ Hi, thanks for the answer. I really like what you had and am curious in how it works. I have the crosswords orientation in the format I will edit into my question, can you gives some advice on how to make certain parts blacked out and how to make a "pairing system" in a way? Thanks again. $\endgroup$ – user52616 Mar 18 '18 at 15:37
  • $\begingroup$ Do you need InputFields at all? Or do you only want to display filled crossword? $\endgroup$ – Kuba Mar 18 '18 at 20:10
  • $\begingroup$ I want to have inputfields, I've later figured out how to solve the problem, thanks for the help thou. $\endgroup$ – user52616 Mar 21 '18 at 16:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.