Skip to content

Commit 9913476

Browse files
author
Roberto De Ioris
committed
added bring_to_front() to SWindow
1 parent 10458da commit 9913476

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

Source/UnrealEnginePython/Private/Slate/UEPySWindow.cpp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,26 @@ static PyObject *py_ue_swindow_request_destroy(ue_PySWindow *self, PyObject * ar
126126
Py_RETURN_NONE;
127127
}
128128

129+
static PyObject *py_ue_swindow_bring_to_front(ue_PySWindow *self, PyObject * args)
130+
{
131+
ue_py_slate_cast(SWindow);
132+
133+
PyObject *py_force = nullptr;
134+
135+
if (!PyArg_ParseTuple(args, "|O:set_as_owner", &py_force))
136+
{
137+
return nullptr;
138+
}
139+
140+
bool bForce = false;
141+
if (py_force && PyObject_IsTrue(py_force))
142+
bForce = true;
143+
144+
py_SWindow->BringToFront(bForce);
145+
146+
Py_RETURN_NONE;
147+
}
148+
129149
#if WITH_EDITOR
130150
static PyObject *py_ue_swindow_add_modal(ue_PySWindow *self, PyObject * args)
131151
{
@@ -189,6 +209,7 @@ static PyMethodDef ue_PySWindow_methods[] = {
189209
{ "get_handle", (PyCFunction)py_ue_swindow_get_handle, METH_VARARGS, "" },
190210
{ "set_as_owner", (PyCFunction)py_ue_swindow_set_as_owner, METH_VARARGS, "" },
191211
{ "request_destroy", (PyCFunction)py_ue_swindow_request_destroy, METH_VARARGS, "" },
212+
{ "bring_to_front", (PyCFunction)py_ue_swindow_bring_to_front, METH_VARARGS, "" },
192213
#if WITH_EDITOR
193214
{ "add_modal", (PyCFunction)py_ue_swindow_add_modal, METH_VARARGS, "" },
194215
#endif

docs/screenshots/slate_SButton.png

15.5 KB
Loading

0 commit comments

Comments
 (0)