Ubuntu Quickly PyGTK and Glade3
<p>I have been using Ubuntu for several years and have been looking for a development environment under Ubuntu to do some things I have had in mind for a while.  It has been frustrating to say the least to find an integrated environment I felt comfortable with.  Then recently I discovered Ubuntu Quickly and thought it looked good especially to someone from a Windows MS Access, VBA background.  So I gave it a go and using DesktopCouch turned out my first app after a few days.</p>

<p>I then found that DesktopCouch is no longer favoured but did not want to go to SQL for my small app and decided to use KirbyBase, all go so far.</p>

<p>I have go a good way to converting (see screen shot) but for the life of me I can not get my head around dialog screens.  The one in the image displays when I run the app but it is not meant to until the user clicks the add or edit buttons.</p>

<p>I have been trying to get the syntax to show, display or make visible the dialog window when the button is clicked for three days and I just can't get it.</p>

<p>I tried setting it up as a separate Ui file like the About and Preferences but this just confused me more.</p>

<p>I think the answer is probable obvious but after three days I need help.  The code for the main window so far is also attached and it is at the OnAddSlang procedure I want to display the dialog, collect the data or otherwise.</p>

<p>By the way I am new to Python as well.</p>

<p>Thank you for your assistance in advance.</p>

<p>Michael![ScreenDump</p>

<p>]<a href="http://i.stack.imgur.com/2UHBo.png" rel="nofollow">1</a>.</p>

<pre><code>enter code here

# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
### BEGIN LICENSE
# This file is in the public domain
### END LICENSE

import sys
import os

import gettext
from gettext import gettext as _
gettext.textdomain('ozslang')

import gtk
import logging
logger = logging.getLogger('ozslang')

from kirbybase import KirbyBase, KBError    #Set up KirbyBase Database



from ozslang_lib import Window
from ozslang.AboutOzslangDialog import AboutOzslangDialog
from ozslang.PreferencesOzslangDialog import PreferencesOzslangDialog
from ozslang.EntryOzslangDialog import EntryOzslangDialog

FILE_EXT = "tbl"

# See ozslang_lib.Window.py for more details about how this class works
class OzslangWindow(Window):
    __gtype_name__ = "OzslangWindow"

    def finish_initializing(self, builder): # pylint: disable=E1002
        """Set up the main window"""
        super(OzslangWindow, self).finish_initializing(builder)

        self.AboutDialog = AboutOzslangDialog
        self.PreferencesDialog = PreferencesOzslangDialog


        # Code for other initialization actions should be added here.
        # Set up KirbyBase Database - Check if Created if not Create it
        # Otherwise Check Read it and Print out Results.

        db = KirbyBase()
        dbTable = "slang.tbl"

        # Table has Record No, Slang, Meaning, Useage, Is Common, Locality and Comment.
        # Fields are Integer, String, String, String, Boolean, String and String.

        # Check if the table exists.

        if os.path.exists('slang.tbl'):
            boolIsCreated = True
            print boolIsCreated

            #recno = db.insert(dbTable, ['Pie Hole', 'Mouth', 'Shut your pie hole', True, 'Australia Wide', 'No Comments 2'])
            result = db.select('slang.tbl', ['recno'], ['*'])
            print result
            barMsg = 'Slang Table is in current directory'
            self.statusbar = builder.get_object("statusbar1")
            self.statusbar_cid = self.statusbar.get_context_id("Status")
            self.statusbar.push(self.statusbar_cid, barMsg)
        else:
            #If it does not exist in this location, create it.

            result = db.create('slang.tbl', ['slang:str', 'meaning:str', 'use:str',
            'iscommon:bool', 'locality:str', 'comment:str'])
            print 'Slang Table Created'
            barMsg = 'Slang Table Created'
            self.statusbar = builder.get_object("statusbar1")
            self.statusbar_cid = self.statusbar.get_context_id("Status")
            self.statusbar.push(self.statusbar_cid, barMsg)
            print 'at end of slang table open create'

    def on_EditSlang(self, widget):
        """Called when the user wants to edit a wine entry"""
        print "In Edit Function"
        pass_

    def OnAddSlang(self, widget):
        print 'In Add Function'
        #Called when the use wants to add a slang
        EntryOzslangDialog.hasfocus = True

        print 'after dialog...'

    def on_btnOK_clicked(self,widget):
        pass

    def on_btnCancel_clicked(self,widget):
        pass

    def _on_close(self, window):
        pass
</code></pre>
