GwibberPosterVBox reports an error and does not submit

Bug #739923 reported by Rick Spencer
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Gwibber
Fix Committed
Undecided
Unassigned
gwibber (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

Binary package hint: gwibber

The following output was supplied:

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/gwibber/lib/gtk/widgets.py", line 68, in on_input_changed
    self.input.textview.set_overlay_text(str(MAX_MESSAGE_LENGTH - cnt))
  File "/usr/lib/python2.7/dist-packages/gwibber/gwui.py", line 1091, in set_overlay_text
    if not self.pango_overlay:
AttributeError: 'InputTextView' object has no attribute 'pango_overlay'

ProblemType: Bug
DistroRelease: Ubuntu 11.04
Package: gwibber 2.91.91.1-0ubuntu1
ProcVersionSignature: Ubuntu 2.6.38-7.36-generic 2.6.38
Uname: Linux 2.6.38-7-generic i686
NonfreeKernelModules: wl
Architecture: i386
Date: Mon Mar 21 19:56:57 2011
InstallationMedia: Ubuntu-Netbook 10.04 "Lucid Lynx" - Alpha i386 (20100329)
ProcEnviron:
 LANGUAGE=en_US:en
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: gwibber
UpgradeStatus: Upgraded to natty on 2010-12-08 (103 days ago)

Revision history for this message
Rick Spencer (rick-rickspencer3) wrote :
Changed in gwibber (Ubuntu):
assignee: nobody → Ken VanDine (ken-vandine)
Revision history for this message
Ken VanDine (ken-vandine) wrote :

I think this was fixed by adding the content inside your expose-event, I am closing this. If you still think there is a bug in the widget, please re-open.

Changed in gwibber (Ubuntu):
status: New → Invalid
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()

Changed in gwibber (Ubuntu):
status: Invalid → New
importance: Undecided → Medium
Revision history for this message
Ken VanDine (ken-vandine) wrote :

I'll try to find a way we can simplify that without removing the counter overlay... tricky

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

could you not simply add "set_text" to the vbox, check if the overlay has been created. If it has, just set the text in the input field, and if it hasn't, store the value and don't apply it until the overlay has been created, for example by connecting to the expose event?

Revision history for this message
Ken VanDine (ken-vandine) wrote :

That's probably a good solution, I'll try to have something prepared for right after beta-1. So expect something you can test before then :)

Changed in gwibber:
status: New → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gwibber - 3.0.0-0ubuntu2

---------------
gwibber (3.0.0-0ubuntu2) natty; urgency=low

  * debian/patches/better_input_handling.patch
    - Don't set editable until the input is exposed (LP: #647406)
    - Added optional content arg to GwibberPosterVBox, so consumers of the
      API won't need to override the expose event to insert default
      contents (LP: #739923)
 -- Ken VanDine <email address hidden> Wed, 06 Apr 2011 15:02:46 -0400

Changed in gwibber (Ubuntu):
status: New → Fix Released
Changed in gwibber:
milestone: none → 3.0.1
Changed in gwibber (Ubuntu):
assignee: Ken VanDine (ken-vandine) → nobody
Revision history for this message
Ken VanDine (ken-vandine) wrote :

Here's a code sample that doesn't require messing with the expose event:

import gtk

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(content=contents)
        poster.input.connect("submit",self.submitted)
        poster.button_send.connect("clicked", self.submitted)
        self.add(poster)
        self.show_all()

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

MicroblogDialog("This is a test")
gtk.main()

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.