FTK Learning Record (IME article)

Source: Internet
Author: User
Tags line editor


"Disclaimer: Copyright all, welcome reprint. Do not use for commercial purposes.

Contact mailbox: feixiaoxing @163.com "


The front is the full screen setting, or please look at it.


watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvzmvpeglhb3hpbmc=/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/ Dissolve/70/gravity/southeast "/>


To see the full screen effect, you can click the button on the left. Suppose you revert to the original result, click the button on the right.

So this demo is actually not complicated.

Of course, the input method we write today is not complicated, it looks very difficult, but for the top users. will be able to use it.

You'll be able to see what the whole demo process will look like at a later moment.


#include "ftk.h" Static Ret button_quit_clicked (void* ctx, void* obj) {ftk_quit (); return RET_OK;} int ftk_main (int argc, char* argv[]) {int width = 0;int height = 0; ftkwidget* win = NULL; ftkwidget* button = NULL; ftkwidget* entry = Null;ftk_init (argc, argv); win = Ftk_app_window_create (); width = ftk_widget_width (win); height = Ftk_wi Dget_height (win); entry = Ftk_entry_create (Win, ten, Ftk_widget_width (win)---); Ftk_entry_set_text (Entry, " Single line editor "); Ftk_entry_set_input_method (entry, 0); entry = Ftk_entry_create (win, ten, N, Ftk_widget_width (win)- Ftk_entry_set_text (Entry, "Single line editor, which means you can input a,"); Ftk_entry_set_input_method (entry, 1); entry = Ftk_entry_create (Win, ten, $, ftk_widget_width (win)---); Ftk_entry_ Set_text (Entry, "single-line editor, which means you can just type a text."); Ftk_entry_set_input_method (entry, 2); button = Ftk_button_create (Win, WIDTH/4, HEIGHT/2, WIDTH/2); ftk_widget_set_ Text (button, "quit"); Ftk_button_set_clicked_listeNER (Button, button_quit_clicked, Win); Ftk_window_set_focus (win, button); entry = Ftk_entry_create (Win, ten, height-60, Ftk_widget_width (Win)-Ftk_entry_set_text (entry, "Single line Editor"), Ftk_entry_set_input_method (entry, 0); Ftk_widget_set_text (Win, "entry demo"); Ftk_widget_show_all (win, 1); Ftk_widget_set_attr (Win, Ftk_attr_quit_when_ CLOSE); Ftk_run (); return 0;}

The contents of the code and previous blogs are not repeated.

The entire code one go, focusing on several entry created in the middle. Once created, you can bind it to the input method. The method is not difficult, just need to use Ftk_entry_set_input_method to set up a bit. The difference is the second parameter of the function, each of which is 0, 1. 2. What effect did it. Just can input Chinese character wubi, Chinese pinyin, English.

Show it. In fact, and we usually use the Sogou input method effect is the same.


Old rules Next show.




Copyright notice: This article blog original articles, blogs, without consent, may not be reproduced.

FTK Learning Record (IME article)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.