acid-drop

- Hacking the planet from a LilyGo T-Deck using custom firmware
git clone git://git.acid.vegas/acid-drop.git
Log | Files | Refs | Archive | README | LICENSE

win.md (1995B)

      1 ```eval_rst
      2 .. include:: /header.rst
      3 :github_url: |github_link_base|/widgets/extra/win.md
      4 ```
      5 # Window (lv_win)
      6 
      7 ## Overview
      8 
      9 The Window is container-like object built from a header with title and buttons and a content area.
     10 
     11 ## Parts and Styles
     12 The Window is built from other widgets so you can check their documentation for details:
     13 - Background: [lv_obj](/widgets/obj)
     14 - Header on the background: [lv_obj](/widgets/obj)
     15 - Title on the header: [lv_label](/widgets/core/label)
     16 - Buttons on the header: [lv_btn](/widgets/core/btn)
     17 - Content area on the background: [lv_obj](/widgets/obj)
     18 
     19 
     20 ## Usage
     21 
     22 ### Create a Window
     23 
     24 `lv_win_create(parent, header_height)` creates a Window with an empty header.
     25 
     26 ### Title and buttons
     27 
     28 Any number of texts (but typically only one) can be added to the header with `lv_win_add_title(win, "The title")`.
     29 
     30 Control buttons can be added to the window's header with `lv_win_add_btn(win, icon, btn_width)`. `icon` can be any image source, and `btn_width` is the width of the button.
     31 
     32 The title and the buttons will be added in the order the functions are called. So adding a button, a text and two other buttons will result in a button on the left, a title, and 2 buttons on the right.
     33 The width of the title is set to take all the remaining space on the header. In other words: it pushes to the right all the buttons that are added after the title.
     34 
     35 ## Get the parts
     36 `lv_win_get_header(win)` returns a pointer to the header, `lv_win_get_content(win)` returns a pointer to the content container to which the content of the window can be added.
     37 
     38 ## Events
     39 No special events are sent by the windows, however events can be added manually to the return value of `lv_win_add_btn`.
     40 
     41 Learn more about [Events](/overview/event).
     42 
     43 ## Keys
     44 No *Keys* are handled by the window.
     45 
     46 Learn more about [Keys](/overview/indev).
     47 
     48 
     49 ## Example
     50 
     51 ```eval_rst
     52 
     53 .. include:: ../../../examples/widgets/win/index.rst
     54 
     55 ```
     56 
     57 
     58 ## API
     59 
     60 ```eval_rst
     61 
     62 .. doxygenfile:: lv_win.h
     63   :project: lvgl
     64 
     65 ```