Skip to content

Commit

Permalink
#1284: test application placing an OR window at a specific location
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@13719 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Sep 14, 2016
1 parent a2d7f8b commit bf6aca3
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions src/tests/xpra/test_apps/test_windows_at.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/usr/bin/env python

import gtk

class TestWindow(gtk.Window):
def __init__(self, window_type, x=100, y=100, w=100, h=100):
gtk.Window.__init__(self, window_type)
self.move(x, y)
self.set_size_request(100, 100)
self.connect("delete_event", gtk.mainquit)
def hello(*args):
print("hello!")
btn = gtk.Button("hello")
btn.connect('clicked', hello)
vbox = gtk.VBox()
vbox.pack_start(btn, False, False, 20)
self.add(vbox)
self.show_all()

def main():
import sys
def intarg(n, default):
if len(sys.argv)<(n-1):
return default
return int(sys.argv[n])
x = intarg(1, 100)
y = intarg(2, 100)
w = intarg(3, 100)
h = intarg(4, 100)

#TestWindow(gtk.WINDOW_TOPLEVEL, x, y, w, h)
TestWindow(gtk.WINDOW_POPUP, x, y, w, h)
gtk.main()


if __name__ == "__main__":
main()

0 comments on commit bf6aca3

Please sign in to comment.