Git Product home page Git Product logo

Comments (2)

lc-soft avatar lc-soft commented on June 2, 2024

现有的设计没提供手动创建和管理多窗口的方法,只提供了个无缝显示模式,也就是给根部件里的每个子部件单独创建窗口,你试试?

LCUIDisplay_SetMode(LCUI_DMODE_SEAMLESS);

这块功能的代码很久没更新了,我不确定是否还有效果。

3.0 版本对这块做了调整,可手动管理窗口,示例代码:

#include <LCUI/platform.h>
#include <LCUI/ui.h>
#include <LCUI/ui/server.h>

...
ui_widget_t *widget;
app_window_t *window;

lcui_init();

widget = ui_create_widget(NULL);
window = app_window_create("窗口", 0, 0, 800, 600);
// 连接部件和窗口
ui_server_connect(widget, window);
// 后续对部件的改动都会由 UIServer 同步到这个窗口
ui_widget_resize(320, 240);
ui_widget_move(400, 400);
ui_widget_set_title("新标题");

lcui_main();

...

// 在其它地方获取部件对应的窗口
window = ui_server_get_window(widget);

...

#include <Windows.h>

// 获取系统窗口句柄
HWND wnd = app_window_get_handle(window);
...

如果你对这块有其它想法和建议的的话可以提出来,我看看能不能在 3.0 版本里实现。

from lcui.

204065248 avatar 204065248 commented on June 2, 2024

现有的设计没提供手动创建和管理多窗口的方法,只提供了个无缝显示模式,也就是给根部件里的每个子部件单独创建窗口,你试试?

LCUIDisplay_SetMode(LCUI_DMODE_SEAMLESS);

这块功能的代码很久没更新了,我不确定是否还有效果。

3.0 版本对这块做了调整,可手动管理窗口,示例代码:

#include <LCUI/platform.h>
#include <LCUI/ui.h>
#include <LCUI/ui/server.h>

...
ui_widget_t *widget;
app_window_t *window;

lcui_init();

widget = ui_create_widget(NULL);
window = app_window_create("窗口", 0, 0, 800, 600);
// 连接部件和窗口
ui_server_connect(widget, window);
// 后续对部件的改动都会由 UIServer 同步到这个窗口
ui_widget_resize(320, 240);
ui_widget_move(400, 400);
ui_widget_set_title("新标题");

lcui_main();

...

// 在其它地方获取部件对应的窗口
window = ui_server_get_window(widget);

...

#include <Windows.h>

// 获取系统窗口句柄
HWND wnd = app_window_get_handle(window);
...

如果你对这块有其它想法和建议的的话可以提出来,我看看能不能在 3.0 版本里实现。

2.2版本怎么多窗口呢,应用场景 Login窗口和Main窗口

from lcui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.