Re: Problems adding menu to panel applet



On 2003.06.13 17:40, Steve Smith Smith wrote:
Have you tried running the applet from the command line to look for error messages (ie run the applet binary and add the applet to the panel using the right click menu)?
So that's the way to go when you want to debug an applet?

I actually tried something like that at one stage, but the applet would crash when I started it that way. Maybe I didn't do it the right way? I'm on a different host now, so I can't test here.

Anyhow, I have now figured out what went wrong with the menu (but I still need debug support to investigate other issues.) It turned out that the fact that I put a button inside the applet caused trouble. I don't remember why I did it that way, but it worked in GNOME 1. After I removed the button and started adding widget that used to be its child (a pixmap) directly to the applet instead, the menu started getting displayed the right way. - Well nearly, I also had to adjust the XML tree a bit. Apparently, "<Root>" and "<popups>" shouldn't be included here.

Regards,
Kevin


From: Toralf Lund <toralf procaptura com>
To: GNOME mailing list <gnome-list gnome org>
Subject: Problems adding menu to panel applet
Date: Wed, 11 Jun 2003 14:44:09 +0200

Now that I've actually been able to load my GNOME 2 applet, I want to add a menu to it. I'm trying the following:

  static const BonoboUIVerb menuVerbs[] = {
    BONOBO_UI_VERB("IntranetAbout", about),
    BONOBO_UI_VERB_END
  };

  static const char menu[]="<Root>\n"
    "  <popups>\n"
    "    <popup name=\"button3\">\n"
    "      <menuitem name=\"about\" verb=\"IntranetAbout\" label=
\"About...\"\n"
    "                pixtype=\"stock\" pixname=\"gnome-stock-about
\"/>\n"
    "    </popup>\n"
    "  </popups>\n"
    "</Root>\n";
panel_applet_setup_menu(PANEL_APPLET(applet), menu, menuVerbs, applet);

But it doesn't seem to work - I get no right-click menu at all, not even one containing buttons like "Remote from panel", "Move" etc.

Can anyone tell me what's wrong?

--
- Toralf

_________________________________________________________________
Tired of spam? Get advanced junk mail protection with MSN 8. http://join.msn.com/?page=features/junkmail




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]