By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,537 Members | 1,440 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,537 IT Pros & Developers. It's quick & easy.

PyGTK Classes Problems

P: n/a
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.

--
Tom Grove

Jul 21 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.