-
-
Notifications
You must be signed in to change notification settings - Fork 171
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* more complete implementation of size-constraints: integrate with ma…
…ximized flag handling and disable resizing if the window is meant to have a fixed size * add sample test applications git-svn-id: https://xpra.org/svn/Xpra/trunk@15631 3bb7dfac-3a0b-4e04-842a-767bc560f471
- Loading branch information
Showing
3 changed files
with
106 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/usr/bin/env python | ||
|
||
import gtk | ||
|
||
WIDTH = 400 | ||
HEIGHT = 200 | ||
|
||
def make_win(width=WIDTH, height=HEIGHT): | ||
window = gtk.Window(gtk.WINDOW_TOPLEVEL) | ||
window.set_title("Fixed Sized Window") | ||
#window.set_size_request(width, height) | ||
window.connect("delete_event", gtk.mainquit) | ||
window.set_geometry_hints(window, | ||
min_width=WIDTH, min_height=HEIGHT, | ||
max_width=WIDTH, max_height=HEIGHT, | ||
) | ||
window.set_resizable(False) | ||
window.show_all() | ||
|
||
def main(): | ||
make_win() | ||
gtk.main() | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/usr/bin/env python | ||
|
||
import gtk | ||
|
||
width = 400 | ||
height = 200 | ||
|
||
def make_win(min_width=0, min_height=0, max_width=0, max_height=0): | ||
window = gtk.Window(gtk.WINDOW_TOPLEVEL) | ||
window.set_title("Size Hints Test") | ||
#window.set_size_request(width, height) | ||
window.connect("delete_event", gtk.mainquit) | ||
window.set_geometry_hints(window, | ||
min_width=min_width, min_height=min_height, | ||
max_width=max_width, max_height=max_height, | ||
base_width=100, base_height=100, | ||
width_inc=8, height_inc=8, | ||
#min_aspect=1, max_aspect=1, | ||
) | ||
window.show_all() | ||
|
||
def main(): | ||
make_win() | ||
make_win(0, 0, width, height) | ||
make_win(width//2, height//2) | ||
make_win(width//2, height//2, width*2, height*2) | ||
gtk.main() | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |