[Glade-users] how to calla the Dialog1



Below is a code that is generated by tepache from a galde2 gtk+ design. 

There is a dialog at my design which is set to visible : no
I want to show it when i press a button that is under the window1

If you help i will be happy.

I know there is functions lile Dialog1.gtk_widget_show but it says:
TypeError: unbound method gtk_widget_show() must be called with
Dialog1 instance as first argument (got nothing instead)

#!/usr/bin/env python
# -*- coding: UTF8 -*-

# Python module sefir.py
# Autogenerated from sefir.glade
# Generated on Tue Jul  5 10:25:18 2005

# Warning: Do not modify any context comment such as #--
# They are required to keep user's code

import os

import gtk

from pyssh import * # pyssh module to enable ssh connection

from SimpleGladeApp import SimpleGladeApp
from SimpleGladeApp import bindtextdomain

app_name = "sefir"
app_version = "0.0.1"

glade_dir = ""
locale_dir = ""

bindtextdomain(app_name, locale_dir)


class Window1(SimpleGladeApp):

    def __init__(self, path="sefir.glade",
                 root="window1",
                 domain=app_name, **kwargs):
        path = os.path.join(glade_dir, path)
        SimpleGladeApp.__init__(self, path, root, domain, **kwargs)

    #-- Window1.new {
    def new(self):
        print "A new %s has been created" % self.__class__.__name__
    #-- Window1.new }

    #-- Window1 custom methods {
    #   Write your own methods here
    #-- Window1 custom methods }

    #-- Window1.on_new1_activate {
    def on_new1_activate(self, widget, *args):
        self.entry3.set_text("")
        self.entry4.set_text("")
    #-- Window1.on_new1_activate }

    #-- Window1.on_cut1_activate {
    def on_cut1_activate(self, widget, *args):
        print "on_cut1_activate called with self.%s" % widget.get_name()
    #-- Window1.on_cut1_activate }

    #-- Window1.on_copy1_activate {
    def on_copy1_activate(self, widget, *args):
        print "on_copy1_activate called with self.%s" % widget.get_name()
    #-- Window1.on_copy1_activate }

    #-- Window1.on_paste1_activate {
    def on_paste1_activate(self, widget, *args):
        print "on_paste1_activate called with self.%s" % widget.get_name()
    #-- Window1.on_paste1_activate }

    #-- Window1.on_delete1_activate {
    def on_delete1_activate(self, widget, *args):
        print "on_delete1_activate called with self.%s" % widget.get_name()
    #-- Window1.on_delete1_activate }

    #-- Window1.on_about1_activate {
    def on_about1_activate(self, widget, *args):
        print "on_about1_activate called with self.%s" % widget.get_name()
    #-- Window1.on_about1_activate }

    #-- Window1.on_button1_clicked {
    def on_button1_clicked(self, widget, *args):
          #Dialog1 something to show the dialog 1 that is initially invisible
    #-- Window1.on_button1_clicked }


class Filechooserdialog1(SimpleGladeApp):

    def __init__(self, path="sefir.glade",
                 root="filechooserdialog1",
                 domain=app_name, **kwargs):
        path = os.path.join(glade_dir, path)
        SimpleGladeApp.__init__(self, path, root, domain, **kwargs)

    #-- Filechooserdialog1.new {
    def new(self):
        print "A new %s has been created" % self.__class__.__name__
    #-- Filechooserdialog1.new }

    #-- Filechooserdialog1 custom methods {
    #   Write your own methods here
    #-- Filechooserdialog1 custom methods }


class Dialog1(SimpleGladeApp):

    def __init__(self, path="sefir.glade",
                 root="dialog1",
                 domain=app_name, **kwargs):
        path = os.path.join(glade_dir, path)
        SimpleGladeApp.__init__(self, path, root, domain, **kwargs)

    #-- Dialog1.new {
    def new(self):
        print "A new %s has been created" % self.__class__.__name__
    #-- Dialog1.new }

    #-- Dialog1 custom methods {
    #   Write your own methods here
    #-- Dialog1 custom methods }


#-- main {

def main():
    window1 = Window1()
    filechooserdialog1 = Filechooserdialog1()
    dialog1 = Dialog1()

    window1.run()

if __name__ == "__main__":
    main()

#-- main }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]