
from gi.repository import Gtk as gtk

def show_dialog(button, window):
    dialog = gtk.Dialog()
    dialog.set_title("Testing Dialog")

    label = gtk.Label("Testing Label...")
    label.show()
    dialog.get_content_area().add(label)

    dialog.set_transient_for(window)
    dialog.present()
    dialog.activate_focus()

def main():
    window = gtk.Window()
    window.set_title("Testing Window")

    button = gtk.Button(label="Open Dialog")
    button.connect('clicked', show_dialog, window)
    button.show()

    window.add(button)
    window.present()
    window.connect('delete-event', lambda w, e: gtk.main_quit())

    gtk.main()

if __name__ == "__main__":
    main()
