1
0
Fork 0
gnuviechadmin-historic/gnome-frontend/src/gnuviech-admin-gnome.py

63 lines
1.7 KiB
Python
Raw Normal View History

#!/usr/bin/python
import pygtk
pygtk.require('2.0')
import gtk
from soapclient import soapclient
class GnuviechAdminGnome:
"""GnuviechAdmin Gnome Interface"""
def hello(self, widget, data = None):
print "Hello World"
def metoo(self, widget, data = None):
print "Me 2"
def delete_event(self, widget, event, data = None):
print "delete event occurred"
return False
def button_press(self, widget, data = None):
print "button pressed"
def change_event(self, widget, data = None):
text = widget.get_text()
print text
self.label.set_text(self.soapclient.echo(text))
def destroy_event(self, widget, data = None):
gtk.main_quit()
def __init__( self ):
self.soapclient = soapclient.SOAPClient()
self.window = gtk.Window()
self.window.connect("delete_event", self.delete_event)
self.window.connect("destroy", self.destroy_event)
button = gtk.Button("Hello world")
self.handler1 = button.connect("clicked", self.hello, None)
button.connect("clicked", self.metoo, None)
button.connect_object("clicked", gtk.Widget.destroy, self.window)
button.connect("pressed", self.button_press, None)
self.textfield = gtk.Entry()
self.textfield.connect("changed", self.change_event)
self.label = gtk.Label()
vbox = gtk.VBox()
vbox.add(button)
vbox.add(self.textfield)
vbox.add(self.label)
self.window.add(vbox)
self.window.show_all()
def main(self):
gtk.main()
if __name__ == '__main__':
g = GnuviechAdminGnome()
g.main()