:right-sidebar: True WindowProperties =================================================================== .. currentmodule:: gi.repository.WebKit .. class:: WindowProperties(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.GObject.Object` Window properties of a :obj:`~gi.repository.WebKit.WebView`\. The content of a :obj:`~gi.repository.WebKit.WebView` can request to change certain properties of the window containing the view. This can include the x, y position of the window, the width and height but also if a toolbar, scrollbar, statusbar, locationbar should be visible to the user, and the request to show the :obj:`~gi.repository.WebKit.WebView` fullscreen. The :obj:`~gi.repository.WebKit.WebView`\::ready-to-show signal handler is the proper place to apply the initial window properties. Then you can monitor the :obj:`~gi.repository.WebKit.WindowProperties` by connecting to ::notify signal. .. code-block:: c :dedent: static void ready_to_show_cb (WebKitWebView *web_view, gpointer user_data) { GtkWidget *window; WebKitWindowProperties *window_properties; gboolean visible; // Create the window to contain the WebKitWebView. window = browser_window_new (); gtk_container_add (GTK_CONTAINER (window), GTK_WIDGET (web_view)); gtk_widget_show (GTK_WIDGET (web_view)); // Get the WebKitWindowProperties of the web view and monitor it. window_properties = webkit_web_view_get_window_properties (web_view); g_signal_connect (window_properties, "notify::geometry", G_CALLBACK (window_geometry_changed), window); g_signal_connect (window_properties, "notify::toolbar-visible", G_CALLBACK (window_toolbar_visibility_changed), window); g_signal_connect (window_properties, "notify::menubar-visible", G_CALLBACK (window_menubar_visibility_changed), window); // Apply the window properties before showing the window. visible = webkit_window_properties_get_toolbar_visible (window_properties); browser_window_set_toolbar_visible (BROWSER_WINDOW (window), visible); visible = webkit_window_properties_get_menubar_visible (window_properties); browser_window_set_menubar_visible (BROWSER_WINDOW (window), visible); if (webkit_window_properties_get_fullscreen (window_properties)) { gtk_window_fullscreen (GTK_WINDOW (window)); } else { GdkRectangle geometry; gtk_window_set_resizable (GTK_WINDOW (window), webkit_window_properties_get_resizable (window_properties)); webkit_window_properties_get_geometry (window_properties, &geometry); gtk_window_move (GTK_WINDOW (window), geometry.x, geometry.y); gtk_window_resize (GTK_WINDOW (window), geometry.width, geometry.height); } gtk_widget_show (window); } Methods ------- .. rst-class:: interim-class .. class:: WindowProperties :no-index: .. method:: get_fullscreen() -> bool Get whether the window should be shown in fullscreen state or not. .. method:: get_geometry() -> ~gi.repository.Gdk.Rectangle Get the geometry the window should have on the screen when shown. .. method:: get_locationbar_visible() -> bool Get whether the window should have the locationbar visible or not. .. method:: get_menubar_visible() -> bool Get whether the window should have the menubar visible or not. .. method:: get_resizable() -> bool Get whether the window should be resizable by the user or not. .. method:: get_scrollbars_visible() -> bool Get whether the window should have the scrollbars visible or not. .. method:: get_statusbar_visible() -> bool Get whether the window should have the statusbar visible or not. .. method:: get_toolbar_visible() -> bool Get whether the window should have the toolbar visible or not. Properties ---------- .. rst-class:: interim-class .. class:: WindowProperties :no-index: .. attribute:: props.fullscreen :type: bool The type of the None singleton. .. attribute:: props.geometry :type: ~gi.repository.Gdk.Rectangle The type of the None singleton. .. attribute:: props.locationbar_visible :type: bool The type of the None singleton. .. attribute:: props.menubar_visible :type: bool The type of the None singleton. .. attribute:: props.resizable :type: bool The type of the None singleton. .. attribute:: props.scrollbars_visible :type: bool The type of the None singleton. .. attribute:: props.statusbar_visible :type: bool The type of the None singleton. .. attribute:: props.toolbar_visible :type: bool The type of the None singleton.