## win控件 创建一个win控件,使用如下代码: ```c sgl_obj_t *win = sgl_win_create(NULL); sgl_obj_set_pos(win, 250, 100); sgl_obj_set_size(win, 300, 200); ``` 上面代码在默认的活动页面上创建了一个大小为300x200的Win控件,并设置其位置为250,100。 ### 设置Win颜色 使用sgl_win_set_color()函数设置Win的颜色,如下: ```c sgl_obj_t *win = sgl_win_create(NULL); sgl_obj_set_pos(win, 250, 100); sgl_obj_set_size(win, 300, 200); sgl_win_set_color(win, SGL_COLOR_WHITE); ``` ### 设置Win圆角 使用sgl_win_set_radius()函数设置Win的圆角,如下: ```c sgl_win_set_radius(win, 10); ``` ### 设置Win透明度 使用sgl_win_set_alpha()函数设置Win的透明度,如下: ```c sgl_win_set_alpha(win, 128); ``` ### 设置Win边框宽度 使用sgl_win_set_border_width()函数设置Win的边框宽度,如下: ```c sgl_win_set_border_width(win, 2); ``` ### 设置Win边框颜色 使用sgl_win_set_border_color()函数设置Win的边框颜色,如下: ```c sgl_win_set_border_color(win, SGL_COLOR_BLACK); ``` ### 设置Win背景图片 使用sgl_win_set_pixmap()函数设置Win的背景图片,如下: ```c extern const sgl_pixmap_t win_pixmap; sgl_win_set_pixmap(win, &win_pixmap); ``` ### 设置Win标题文本 使用sgl_win_set_title_text()函数设置Win的标题文本,如下: ```c sgl_win_set_title_text(win, "窗口标题"); ``` ### 设置Win标题文本颜色 使用sgl_win_set_title_text_color()函数设置Win的标题文本颜色,如下: ```c sgl_win_set_title_text_color(win, SGL_COLOR_WHITE); ``` ### 设置Win标题字体 使用sgl_win_set_title_font()函数设置Win的标题字体,如下: ```c sgl_win_set_title_font(win, &consolas24); ``` ### 设置Win标题高度 使用sgl_win_set_title_height()函数设置Win的标题高度,如下: ```c sgl_win_set_title_height(win, 40); ``` ### 设置Win标题文本对齐 使用sgl_win_set_title_text_align()函数设置Win的标题文本对齐,如下: ```c sgl_win_set_title_text_align(win, SGL_ALIGN_CENTER); ``` ### 设置Win标题背景颜色 使用sgl_win_set_title_bg_color()函数设置Win的标题背景颜色,如下: ```c sgl_win_set_title_bg_color(win, SGL_COLOR_BLUE); ``` ### 设置Win关闭按钮颜色 使用sgl_win_set_close_btn_color()函数设置Win的关闭按钮颜色,如下: ```c sgl_win_set_close_btn_color(win, SGL_COLOR_RED); ```