PyGTK Classes Problems

Discussion in 'Python' started by Tom Grove, Jul 21, 2006.

  1. Tom Grove

    Tom Grove Guest

    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
    Tom Grove, Jul 21, 2006
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Andre Lerche

    treeview / pygtk problem

    Andre Lerche, Jul 10, 2003, in forum: Python
    Replies:
    3
    Views:
    440
    David M. Cook
    Jul 11, 2003
  2. Dave Walker

    Problems with pygtk/gtk.glade

    Dave Walker, Jul 22, 2004, in forum: Python
    Replies:
    1
    Views:
    348
    Haim Ashkenazi
    Jul 22, 2004
  3. Sridhar  R

    Re: Problems with pygtk/gtk.glade

    Sridhar R, Jul 23, 2004, in forum: Python
    Replies:
    1
    Views:
    326
    Dave Walker
    Jul 23, 2004
  4. barcaroller

    PyGTK problems after Linux update...

    barcaroller, Aug 28, 2009, in forum: Python
    Replies:
    4
    Views:
    1,030
    barcaroller
    Sep 2, 2009
  5. Yang
    Replies:
    1
    Views:
    1,785
    News123
    Oct 29, 2009
Loading...

Share This Page