Skip to content

How do you make windows 100% width + height with python? #134

Answered by Consolatis
godalming123 asked this question in Q&A
Discussion options

You must be logged in to vote

Could be used to implement a desktop background with icons and context menu:

#!/usr/bin/env python3

import gi

gi.require_version("Gtk", "3.0")
gi.require_version('GtkLayerShell', '0.1')
from gi.repository import Gtk, GtkLayerShell

if __name__ == '__main__':
	win = Gtk.Window()
	GtkLayerShell.init_for_window(win)
	for anchor in ('LEFT', 'RIGHT', 'TOP', 'BOTTOM'):
		GtkLayerShell.set_anchor(win, getattr(GtkLayerShell.Edge, anchor), True)
	GtkLayerShell.set_layer(win, GtkLayerShell.Layer.BOTTOM)
	win.show_all()
	Gtk.main()

Regarding documentation: There is http://lazka.github.io/pgi-docs/#GtkLayerShell-0.1

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by wmww
Comment options

You must be logged in to vote
1 reply
@godalming123
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants