c - Xlib: draw a text input box and read text as it is typed -
i trying implement text box user can type, use arrow keys, backspace, delete, etc. able know in text box without user needing submit anything. suppose catch keypress events, find way display cursor, , build min-text-editor hand--but maybe reinventing wheel?
what after rather scrabble-like. have several letters in top part of window , text box in bottom. each time type letter disappears top pane know when you've used them up. want able edit text arrow keys, 'cause rather 7 letters scrabble give me hope doing paragraphs.
i have window displaying, , source file processed , displayed list of allowable letters... want update list of allowable letters while user types in sentence. can xlib this? there else might more suitable? thanks!
can xlib this?why yes, xlib can lot of things. describe seems simple enough using x's event processing , drawing functions.
xlib pretty crufty, though, , imo should use if need closeness x protocol. (even there newer replacements xcb. digress.)
you might find easier work modern toolkit, gtk+ or qt.
for example, might expressed gtkentry "key-press-event" handler.
Comments
Post a Comment