Code review comment for lp:~smartgpx/bzr-gtk/workaround_for_lp494140

Revision history for this message
David Roberts (smartgpx) wrote :

Thank you for your attempt to 'mentor' by giving me the opportunity to
explore this.

I thought it was beyond my gtk/python skills at present. But I've got
a proposal.

My thinking is as follows. 'self.prev_button.set_menu' expects self to
be a MenuToolButton, which we should have established by calling
set_tool_item_type.
But for PyGtk < 2.10 we haven't done that.

But to avoid the runtime error we can at least inspect whether we can
call set_menu
on the button we actually have...

And we need to do this twice, for prev_button and next_button.

Seems to run Visualize cleanly now.

Did I merge your changes correctly and following correct etiquette/attribution?

2009/12/9 Vincent Ladeuil <email address hidden>:
> Review: Needs Fixing
> With your patch, brz viz issues a warning:
>
> Traceback (most recent call last):
>  File "/home/vila/.bazaar/plugins/gtk/viz/branchwin.py", line 416, in _treeselection_changed_cb
>    self.prev_button.set_menu(prev_menu)
> AttributeError: 'gtk.ToolButton' object has no attribute 'set_menu'
>
> I added some getattr() calls so that the code is still active for PyGtk-2.10, can you merge it and check it still works for you ?
>
> The branch is: lp:~vila/bzr-gtk/494140-xandros-compat
>
> You can push your branch again when you've got a working version.
> --
> https://code.edge.launchpad.net/~smartgpx/bzr-gtk/workaround_for_lp494140/+merge/15855
> You are the owner of lp:~smartgpx/bzr-gtk/workaround_for_lp494140.
>

« Back to merge proposal