Comment 3 for bug 739923

Revision history for this message
Rick Spencer (rick-rickspencer3) wrote :

I *worked around* the bug in that manner, but I don't think we should call it a fix. I also had to disconnect from the expose event to keep the the users input from being continually written over.

import gtk

from photobomb.photobombconfig import getdatapath
from gwibber.lib.gtk import widgets

class MicroblogDialog(gtk.Window):

    def __init__(self, contents, parent=None):
        gtk.Window.__init__(self)
        self.set_default_size(420,140)
        poster = widgets.GwibberPosterVBox()
        poster.input.connect("submit",self.submitted)
        poster.button_send.connect("clicked", self.submitted)
        self.expose_event = poster.connect("expose-event", self.on_expose_input, contents)
        self.add(poster)
        self.show_all()

    def on_expose_input(self, widget, event, contents):
        widget.disconnect(self.expose_event)
        widget.input.set_text(contents)

    def submitted(self, *args):
        self.destroy()