g_return_if_fail (GTK_IS_WINDOW (window));
if ((window->focus_widget != focus) ||
- (focus && !GTK_WIDGET_HAS_FOCUS (focus)))
+ (focus && !gtk_widget_has_focus (focus)))
g_signal_emit (window, window_signals[SET_FOCUS], 0, focus);
}
* Retrieves the current focused widget within the window.
* Note that this is the widget that would have the focus
* if the toplevel window focused; if the toplevel window
- * is not focused then <literal>GTK_WIDGET_HAS_FOCUS (widget)</literal> will
+ * is not focused then <literal>gtk_widget_has_focus (widget)</literal> will
* not be %TRUE for the widget.
*
* Return value: (transfer none): the currently focused widget, or %NULL if there is none.
gtk_window_set_modal (GtkWindow *window,
gboolean modal)
{
+ GtkWidget *widget;
+
g_return_if_fail (GTK_IS_WINDOW (window));
modal = modal != FALSE;
return;
window->modal = modal;
+ widget = GTK_WIDGET (window);
/* adjust desired modality state */
if (GTK_WIDGET_REALIZED (window))
{
- GtkWidget *widget = GTK_WIDGET (window);
-
if (window->modal)
gdk_window_set_modal_hint (widget->window, TRUE);
else
gdk_window_set_modal_hint (widget->window, FALSE);
}
- if (GTK_WIDGET_VISIBLE (window))
+ if (gtk_widget_get_visible (widget))
{
if (window->modal)
- gtk_grab_add (GTK_WIDGET (window));
+ gtk_grab_add (widget);
else
- gtk_grab_remove (GTK_WIDGET (window));
+ gtk_grab_remove (widget);
}
g_object_notify (G_OBJECT (window), "modal");
GTK_WIDGET_SET_FLAGS (widget, GTK_MAPPED);
if (window->bin.child &&
- GTK_WIDGET_VISIBLE (window->bin.child) &&
+ gtk_widget_get_visible (window->bin.child) &&
!GTK_WIDGET_MAPPED (window->bin.child))
gtk_widget_map (window->bin.child);
requisition->width = GTK_CONTAINER (window)->border_width * 2;
requisition->height = GTK_CONTAINER (window)->border_width * 2;
- if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
+ if (bin->child && gtk_widget_get_visible (bin->child))
{
GtkRequisition child_requisition;
window = GTK_WINDOW (widget);
widget->allocation = *allocation;
- if (window->bin.child && GTK_WIDGET_VISIBLE (window->bin.child))
+ if (window->bin.child && gtk_widget_get_visible (window->bin.child))
{
child_allocation.x = GTK_CONTAINER (window)->border_width;
child_allocation.y = GTK_CONTAINER (window)->border_width;
* the window is visible before actually handling the
* event
*/
- if (GTK_WIDGET_VISIBLE (widget))
+ if (gtk_widget_get_visible (widget))
{
_gtk_window_set_has_toplevel_focus (window, TRUE);
_gtk_window_set_is_active (window, TRUE);
static void
gtk_window_check_resize (GtkContainer *container)
{
- GtkWindow *window = GTK_WINDOW (container);
-
- if (GTK_WIDGET_VISIBLE (container))
- gtk_window_move_resize (window);
+ if (gtk_widget_get_visible (GTK_WIDGET (container)))
+ gtk_window_move_resize (GTK_WINDOW (container));
}
static gboolean
widget = GTK_WIDGET (window);
- if (GTK_WIDGET_VISIBLE (window))
+ if (gtk_widget_get_visible (widget))
{
g_assert (widget->window != NULL);
GdkWindow *toplevel;
g_return_if_fail (GTK_IS_WINDOW (window));
- g_return_if_fail (GTK_WIDGET_VISIBLE (window));
-
widget = GTK_WIDGET (window);
+ g_return_if_fail (gtk_widget_get_visible (widget));
if (window->frame)
toplevel = window->frame;
GdkWindow *toplevel;
g_return_if_fail (GTK_IS_WINDOW (window));
- g_return_if_fail (GTK_WIDGET_VISIBLE (window));
-
widget = GTK_WIDGET (window);
+ g_return_if_fail (gtk_widget_get_visible (widget));
if (window->frame)
toplevel = window->frame;
{
if (window->focus_widget &&
window->focus_widget != widget &&
- !GTK_WIDGET_HAS_FOCUS (window->focus_widget))
+ !gtk_widget_has_focus (window->focus_widget))
do_focus_change (window->focus_widget, TRUE);
}
else
{
if (window->focus_widget &&
window->focus_widget != widget &&
- GTK_WIDGET_HAS_FOCUS (window->focus_widget))
+ gtk_widget_has_focus (window->focus_widget))
do_focus_change (window->focus_widget, FALSE);
}
}