Bug 552796 - ibus languagebar doesn't show MenuItem on menu.
Summary: ibus languagebar doesn't show MenuItem on menu.
Alias: None
Product: Fedora
Classification: Fedora
Component: ibus
Version: rawhide
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Peng Huang
QA Contact: Fedora Extras Quality Assurance
Depends On:
Blocks: 550001
TreeView+ depends on / blocked
Reported: 2010-01-06 07:03 UTC by fujiwara
Modified: 2010-01-11 06:49 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2010-01-11 06:49:37 UTC
Type: ---

Attachments (Terms of Use)
Patch for ibus menu.py (1.67 KB, patch)
2010-01-06 07:05 UTC, fujiwara
no flags Details | Diff

Description fujiwara 2010-01-06 07:03:38 UTC
I'd like to add MenuItem on ibus languagebar with bug 550001.

Currently ibus supports CheckMenuItem() and RadioMenuItem() but it seems ImageMenuItem() doesn't work.

When I apply the patch on bug 550001, ibus puts an error:
ibus.Menu receives type == ibus.PROP_TYPE_NORMAL and call gtk.ImageMenuItem(prop)
but the argument is not correct.
I'm attaching the patch.

Comment 1 fujiwara 2010-01-06 07:05:38 UTC
Created attachment 381928 [details]
Patch for ibus menu.py

Attached the patch.
It seems to get an error when gtk.ImageMenuItem.__init__() is called so I removed it.

Comment 2 fujiwara 2010-01-06 08:48:45 UTC
Comment on attachment 381928 [details]
Patch for ibus menu.py

>diff --git a/ui/gtk/menu.py b/ui/gtk/menu.py

One typo. Both icon and label can be shown:

              self.set_image(icon.IconWidget(prop.icon, size[0]))
-+        elif self._prop.label:
++        if self._prop.label:
 +            self.set_property("label", prop.label.get_text())

Comment 3 fujiwara 2010-01-07 03:44:26 UTC
Put ibus-anthy for ImageMenuItem:

Comment 4 fujiwara 2010-01-07 04:22:06 UTC
F11 pygtk2 had a problem:
--- a/gtk/gtk.override
+++ b/gtk/gtk.override
@@ -2064,24 +2066,20 @@ _wrap_gtk_image_menu_item_new(PyGObject *self, PyObject *args,PyObject *kwargs)
- if (pyg_type_from_object((PyObject *) self) != GTK_TYPE_IMAGE_MENU_ITEM) {
- PyErr_SetString(PyExc_RuntimeError, "__gobject_init__ must be used "
- "when subclassing gtk.ImageMenuItem");
- return -1;
- }
- pygobject_register_wrapper((PyObject *)self);

The previous pygtk sent the error: "__gobject_init__ must be used when subclassing gtk.ImageMenuItem".

But I confirmed f12 _gtk.so is fixed so this part is not needed now.
I logged this issue for the reference.

Comment 5 Peng Huang 2010-01-07 05:15:26 UTC
Fixed in upstream. I will build it soon.

Comment 6 Peng Huang 2010-01-11 06:49:37 UTC
Fixed in ibus-

Note You need to log in before you can comment on or make changes to this bug.