Skip to content

Repositioning the window #263

Answered by WhoAteDaCake
WhoAteDaCake asked this question in Q&A
Discussion options

You must be logged in to vote

Ended up doing a bit of a hacky workaround, to move the window after it's been resized once, I'll move it and then ignore the remaining events.

#include <LCUI_Build.h>
#include <LCUI/LCUI.h>
#include <LCUI/gui/widget.h>
#include <LCUI/gui/builder.h>
#include <LCUI/gui/widget/textview.h>
#include <LCUI/gui/widget/textedit.h>
#include <stdio.h>
#include <LCUI/display.h>

static void OnBtnClick(LCUI_Widget self, LCUI_WidgetEvent e, void *arg)
{
	wchar_t str[256];
	LCUI_Widget edit = LCUIWidget_GetById("edit");
	LCUI_Widget txt = LCUIWidget_GetById("text-hello");

	TextEdit_GetTextW(edit, 0, 255, str);
	TextView_SetTextW(txt, str);
}

// Only care to run this once, so after resize is updated
/…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by WhoAteDaCake
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant