PyGTK Classes Problems

T

Tom Grove

I can't seem to get a function to continue after I call another gtk
window class. Basically I need to grab a date from a calendar in one
windows and insert that value into an entry box on the calling window.

Calling Window:
import winCal

def getDate(self, widget):
cimsCal.winCal.dateSelected =
"DATE"

cimsCal.winCal()

print
"TEST"

self.wTree.get_widget("entDate").set_text(cimsCal.winCal.dateSelected)

WinCal Class:
#!/usr/bin/env python

import
sys

import
pygtk

import
gtk

import
gtk.glade



# Create a class which is the actual program to be
run
class
winCal(gtk.Window):

#
Globals

dateSelected =
""



# This is where we hook in our glade file and connect to the gui
stuff
def
__init__(self):

gladefile =
"cimsGui/cimsgui.glade"

self.windowname =
"winCal"
self.wTree = gtk.glade.XML(gladefile,
self.windowname)


# Create a dictionary of function
calls
dic = { "on_calendar1_day_selected_double_click" :
self.giveDate

}




self.wTree.signal_autoconnect(dic)




gtk.main()



# Start
Functions

def giveDate(self,
widget):

self.dateSelected =
self.wTree.get_widget("calendar1").get_date()

self.wTree.get_widget("winCal").destroy()



if __name__ ==
'__main__':

app = winCal()

After I do this cimsCal.winCal() the print "TEST" never happens. What
am I doing wrong.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top