-
-
Notifications
You must be signed in to change notification settings - Fork 169
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#1284: test application placing an OR window at a specific location
git-svn-id: https://xpra.org/svn/Xpra/trunk@13719 3bb7dfac-3a0b-4e04-842a-767bc560f471
- Loading branch information
Showing
1 changed file
with
37 additions
and
0 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
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() |