WebKit2.WindowProperties¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/co |
|||
r/w/co |
|||
r/w/co |
|||
r/w/co |
|||
r/w/co |
|||
r/w/co |
|||
r/w/co |
|||
r/w/co |
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
Class Details¶
- class WebKit2.WindowProperties(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
Window properties of a
WebKit2.WebView
.The content of a
WebKit2.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 theWebKit2.WebView
fullscreen.The
WebKit2.WebView
::ready-to-show
signal handler is the proper place to apply the initial window properties. Then you can monitor theWebKit2.WindowProperties
by connecting to::notify
signal.```c static void ready_to_show_cb (
WebKit2.WebView
*web_view,object
user_data) {Gtk.Widget
*window;WebKit2.WindowProperties
*window_properties;bool
visible;// Create the window to contain the
WebKit2.WebView
. window = browser_window_new ();Gtk.Container.add
(GTK_CONTAINER (window), GTK_WIDGET (web_view));Gtk.Widget.show
(GTK_WIDGET (web_view));// Get the
WebKit2.WindowProperties
of the web view and monitor it. window_properties =WebKit2.WebView.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 =
WebKit2.WindowProperties.get_toolbar_visible
(window_properties); browser_window_set_toolbar_visible (BROWSER_WINDOW (window), visible); visible =WebKit2.WindowProperties.get_menubar_visible
(window_properties); browser_window_set_menubar_visible (BROWSER_WINDOW (window), visible);if (
WebKit2.WindowProperties.get_fullscreen
(window_properties)) {Gtk.Window.fullscreen
(GTK_WINDOW (window)); } else {Gdk.Rectangle
geometry;Gtk.Window.set_resizable
(GTK_WINDOW (window),WebKit2.WindowProperties.get_resizable
(window_properties));WebKit2.WindowProperties.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); } ```- get_fullscreen()¶
-
Get whether the window should be shown in fullscreen state or not.
- get_geometry()¶
- Returns:
return location for the window geometry
- Return type:
geometry:
Gdk.Rectangle
Get the geometry the window should have on the screen when shown.
- get_locationbar_visible()¶
-
Get whether the window should have the locationbar visible or not.
-
Get whether the window should have the menubar visible or not.
- get_resizable()¶
-
Get whether the window should be resizable by the user or not.
- get_scrollbars_visible()¶
-
Get whether the window should have the scrollbars visible or not.
- get_statusbar_visible()¶
-
Get whether the window should have the statusbar visible or not.
Property Details¶
- WebKit2.WindowProperties.props.fullscreen¶
- Name:
fullscreen
- Type:
- Default Value:
- Flags:
Whether window will be displayed fullscreen.
- WebKit2.WindowProperties.props.geometry¶
- Name:
geometry
- Type:
- Default Value:
- Flags:
The size and position of the window on the screen.
- WebKit2.WindowProperties.props.locationbar_visible¶
- Name:
locationbar-visible
- Type:
- Default Value:
- Flags:
Whether the locationbar should be visible for the window.
- Name:
menubar-visible
- Type:
- Default Value:
- Flags:
Whether the menubar should be visible for the window.
- WebKit2.WindowProperties.props.resizable¶
- Name:
resizable
- Type:
- Default Value:
- Flags:
Whether the window can be resized.
- WebKit2.WindowProperties.props.scrollbars_visible¶
- Name:
scrollbars-visible
- Type:
- Default Value:
- Flags:
Whether the scrollbars should be visible for the window.
- WebKit2.WindowProperties.props.statusbar_visible¶
- Name:
statusbar-visible
- Type:
- Default Value:
- Flags:
Whether the statusbar should be visible for the window.