0

私は PYGTK を使用して、wGet と Python の両方を使用して、非常に単純なダウンロード マネージャーをプログラムしています。すべてうまくいきますが、多くの画面スペースを消費します...私のコード:

#!/usr/bin/python
import gtk
import os
def submitdownload(self):
    os.system("wget "+site.get_text() + " -P  "+ directory.get_text())
main=gtk.Window()
main.set_title("Simple Downloader with wGet")
structure=gtk.Table(2, 6, True)
label=gtk.Label("Simple downloader with wGet")
sitedes=gtk.Label("Your download link:")
site=gtk.Entry()
submit=gtk.Button("Submit download")
submit.connect("clicked", submitdownload)
directorydes=gtk.Label("Save to: ")
directory=gtk.Entry()
description=gtk.Label("Please don't close the black box (terminal window) or the application will close automatically. It is needed for the download.")
main.add(structure)
structure.attach(label, 0, 2, 0, 1)
structure.attach(sitedes, 0, 1, 1, 2)
structure.attach(site, 1, 2, 1, 2)
structure.attach(submit, 0, 2, 4, 5)
structure.attach(directorydes, 0, 1, 2, 3)
structure.attach(directory, 1, 2, 2, 3)
structure.attach(description, 0, 2, 5, 6)
main.connect("destroy", lambda w: gtk.main_quit())
main.show_all()
gtk.main()

右側に多くの未使用スペースがスローされます。それを修正する方法は?「X」ボタンでアプリケーションを閉じるのは非常に困難です。

4

1 に答える 1