Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

at last I started a simple project (you tube video downloader) in quickly , But got stucked . I added youtube url entry dialog using quickly add dialog command and ;linked it to new button . How return url to the main window ? I don't have any previous experiance with python

My program now look like this

enter image description here

share|improve this question

1 Answer 1

up vote 2 down vote accepted

Depending on your code, you could do something like this:

url = None
dialog = UrlDialog()
response = dialog.run()
if response == Gtk.ResponseType.OK:
    url = dialog.get_url()
dialog.destroy()

Then just implement a get_url() method or url property in your dialog class:

class UrlDialog(Gtk.Dialog):
    # Init etc...

    def get_url(self):
        return self.urlentry.get_text()
share|improve this answer
    
Thanks now it shows File "/home/aboobacker/mytube2/mytube2/Mytube2Window.py", line 34, in on_newurlbutton_clicked url = dialog.get_url() File "/home/aboobacker/mytube2/mytube2/NewurlDialog.py", line 61, in get_url return self.newurlentry.get_text() AttributeError: 'NewurlDialog' object has no attribute 'newurlentry' What does it mean ? –  Tachyons Jul 2 '12 at 14:00
    
It worked ,thanks –  Tachyons Jul 2 '12 at 14:38

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.