class ConnectionDialog(Gtk.Dialog): def __init__(self, app): Gtk.Dialog.__init__(self, "Kleet", app, 0) self.app = app button = Gtk.Button("Connect") button.connect("clicked", self.get_tweets) self.ta = TwitterObj() self.entry = Gtk.Entry() urlLabel = Gtk.Label(self.ta.get_auth_url(), selectable=True) containerBox = self.get_content_area() containerBox.pack_start(urlLabel, True, True, 0) containerBox.pack_start(self.entry, True, True, 0) containerBox.pack_start(button, True, True, 0) self.show_all() def get_tweets(self, widget): tweets = self.ta.get_tweets(self.entry.get_text()) for tweet in tweets: tweetGrid = TweetBox(tweet['imgFilePath'], tweet['name'], tweet['text']) self.app.containerTweets.pack_start(tweetGrid, True, True, 5) self.app.show_all() self.destroy()
class ConnectionDialog(Gtk.Dialog): def __init__(self, app): Gtk.Dialog.__init__(self, "Kleet", app, 0) self.app = app button = Gtk.Button("Connect") button.connect("clicked", self.get_tweets) self.ta = TwitterObj() self.entry = Gtk.Entry() urlLabel = Gtk.Label(self.ta.get_auth_url(), selectable=True) containerBox = self.get_content_area() containerBox.pack_start(urlLabel, True, True, 0) containerBox.pack_start(self.entry, True, True, 0) containerBox.pack_start(button, True, True, 0) self.show_all() def get_tweets(self, widget): tweets = self.ta.get_tweets(self.entry.get_text()) for tweet in tweets: tweetGrid = TweetBox(tweet["imgFilePath"], tweet["name"], tweet["text"]) self.app.containerTweets.pack_start(tweetGrid, True, True, 5) self.app.show_all() self.destroy()
def __init__(self, app): Gtk.Dialog.__init__(self, "Kleet", app, 0) self.app = app button = Gtk.Button("Connect") button.connect("clicked", self.get_tweets) self.ta = TwitterObj() self.entry = Gtk.Entry() urlLabel = Gtk.Label(self.ta.get_auth_url(), selectable=True) containerBox = self.get_content_area() containerBox.pack_start(urlLabel, True, True, 0) containerBox.pack_start(self.entry, True, True, 0) containerBox.pack_start(button, True, True, 0) self.show_all()