RealDocs

UCanvasPanel::GetCanvasWidget

function UMG Since 4.0
#include "Components/CanvasPanel.h"
Access: public Specifiers: const

Description

Returns the underlying native Slate widget (SConstraintCanvas) backing this canvas panel, if it has been constructed.

Caveats & Gotchas

  • Not UFUNCTION-exposed, so it's only callable from C++, not Blueprint.
  • Returns an invalid (null) pointer until the native widget has actually been built — e.g. before the containing widget tree is constructed or added to the viewport.

Signature

TSharedPtr<class SConstraintCanvas> GetCanvasWidget() const

Return Type

TSharedPtr<class SConstraintCanvas>

Example

Access the native Slate widget C++
TSharedPtr<SConstraintCanvas> Native = CanvasPanel->GetCanvasWidget();
if (Native.IsValid())
{
	Native->Invalidate(EInvalidateWidgetReason::Layout);
}

Tags

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.