Add checks for null GtkWidget

Gtk complained about invalid widgets, because they were null.
This commit is contained in:
scorpion-26 2023-11-05 22:02:58 +01:00
parent eb8e0bc2b5
commit dc7c7b7902

View file

@ -162,6 +162,7 @@ void Widget::RemoveChild(Widget* widget)
void Widget::SetVisible(bool visible)
{
if (m_Widget)
gtk_widget_set_visible(m_Widget, visible);
}
@ -683,6 +684,7 @@ void Slider::SetOrientation(Orientation orientation)
void Slider::SetValue(double value)
{
if (m_Widget)
gtk_range_set_value((GtkRange*)m_Widget, value);
}