diff --git a/README.md b/README.md index 712899d..2a12843 100644 --- a/README.md +++ b/README.md @@ -117,42 +117,42 @@ StellarX/ ```cpp // 只需包含这一个头文件即可使用所有功能 -#include "StellarX/StellarX.h" +#include "StellarX.h" // 程序入口点(请使用WinMain以获得更好的兼容性) int WINAPI WinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _In_ LPSTR lpCmdLine, _In_ int nShowCmd) { - - // 1. 创建一个640x480的窗口,背景为白色,标题为"我的应用" - StellarX::Window mainWindow(640, 480, 0, RGB(255, 255, 255), "我的第一个星垣应用"); - // 2. 创建一个按钮 (使用智能指针管理) - auto myButton = std::make_unique( - 250, 200, 140, 40, // x, y, 宽度, 高度 - "点击我", // 按钮文本 - StellarX::ButtonMode::NORMAL, - StellarX::ControlShape::ROUND_RECTANGLE - ); + // 1. 创建一个640x480的窗口,背景为白色,标题为"我的应用" + Window mainWindow(640, 480, 0, RGB(255, 255, 255), "我的第一个星垣应用"); - // 3. 为按钮设置点击事件(使用Lambda表达式) - myButton->setOnClickListener([]() { - MessageBox(nullptr, L"Hello, 星垣!", L"问候", MB_OK | MB_ICONINFORMATION); - }); + // 2. 创建一个按钮 (使用智能指针管理) + auto myButton = std::make_unique