91321146 Posted November 28, 2016 Report Posted November 28, 2016 Hi Joel May you tell me how can I get index of texted it by keyboard widget?for an example if I typed 50 do something . Thanks if answer
Joel Bodenmann Posted November 28, 2016 Report Posted November 28, 2016 Hello there, I'm sorry but unfortunately I don't understand your question. Can you please try to rephrase your question? In case of your question is how to convert the string/characters to actual numeric values: That is something you have to do yourself. That is not part of uGFX. The Textedit widget only provides you with an interface to enter text. Parsing the text into numeric values requires to know what kind of text is expected. Usually you'd use something like sscanf() to convert from text to numeric values. Note that the GFILE module provides implementations of sscanf() called sscang() that you can use. This way you don't have to pull all the libc dependencies into your project. You can find an more information in the corresponding documentation: https://wiki.ugfx.io/index.php/GFILE#String_manipulation_.26_printing
91321146 Posted November 28, 2016 Author Report Posted November 28, 2016 Hi Joel In textedit widget we type every thing we want ,ok? Now I want to write a code that when user typed for an example 50 in textedit with virtual keyboard (widget) and pressed "ok" button on screen ,it show another page.but the contents of textedit is important . for an example maybe user typed 40,so another page must appear. I want to access the content of text edit as a programmer who writes this code.i saw structure of textedit in textedit . c but I couldn't notice how should I access to content. May you help ?
Joel Bodenmann Posted November 28, 2016 Report Posted November 28, 2016 The Textedit widget uses the text attribute provided by the GWidget class. Therefore, gwinGetText() can be used to retrieve the current text of the Textedit as @inmarket mentioned.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now