fix some typos

This commit is contained in:
tangcl 2024-01-21 23:03:09 +08:00
parent e8c7d6c648
commit 4890ae921d
2 changed files with 2 additions and 2 deletions

View File

@ -107,7 +107,7 @@ So far ``_gui_setup`` is empty. Create a window by adding the following lines wi
As far as EFL is concerned, a window is just another object. You can declare it with ``Eo *win;``. The ``Eo`` type is the base object system for EFL. Most graphical elements such as windows, text boxes, buttons, sliders, etc. are ``Eo`` objects. You can give your window any name you wish but for now call it ``win``for simplicity's sake.
The next part of the code defines the window itself. The ``efl_add()`` method creates a new object of the class specified in the first parameter and puts it inside the already existing object specified in the second parameter. In an EFL graphical application widgets are inserted inside other objects. For example, you can place a text object inside a text box inside a window and so on. In this case we want to create a window (``EFL_UI_WIN _CLASS``) which must be a child of the application's main loop, so it can receive application events (see the [Main Loop programming guide](/develop/guides/c/core/main-loop.md)). You can always retrieve the application's main loop using ``efl_main_loop_get()``.
The next part of the code defines the window itself. The ``efl_add()`` method creates a new object of the class specified in the first parameter and puts it inside the already existing object specified in the second parameter. In an EFL graphical application widgets are inserted inside other objects. For example, you can place a text object inside a text box inside a window and so on. In this case we want to create a window (``EFL_UI_WIN_CLASS``) which must be a child of the application's main loop, so it can receive application events (see the [Main Loop programming guide](/develop/guides/c/core/main-loop.md)). You can always retrieve the application's main loop using ``efl_main_loop_get()``.
The rest of the parameters of ``efl_add()`` are a list of methods that will be called in order, normally to configure the object we have just created. You can add as many configuration methods as you want in this list and can use the special symbol ``efl_added`` to refer to the created object if you need to.

View File

@ -149,7 +149,7 @@ The ``Efl_Event`` structure contains an array with all the command line paramete
Finally, the array can be found in ``args->argv``. Arrays in EFL are handled with the ``Eina_Array`` type, so you can use ``eina_array_count()`` to retrieve the number of elements in an array and ``eina_array_data_get()`` to access the contents of the array.
In the above example, if no parameters are passed to your program (``eina_array_count(args->argv) == 0``), it just prints "Hello World!". Otherwise, the first parameter is retrieved and printed. Try compiling again your program and running it with your name as the first parameter:
In the above example, if no parameters are passed to your program (``eina_array_count(args->argv) == 1``), it just prints "Hello World!". Otherwise, the first parameter is retrieved and printed. Try compiling again your program and running it with your name as the first parameter:
```bash
./hello-world Mike