| Author |
Message |
RSH

Joined: 05 Sep 2011 Posts: 1564 Location: Germany
|
Posted: Wed 12 Sep 2012, 17:54 Post subject:
C Language - Icon for right-click menu in C? Subject description: ? ? ? |
|
Hi.
I want to have an icon for a menu entry.
| Code: | menuitem = gtk_menu_item_new_with_label("LazY FReD Free Repository Downloader");
g_signal_connect(menuitem, "activate", (GCallback) view_popup_menu_run_lazy_fred, status_icon);
gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
|
Full Code here
What do i have to change, to have an icon in a menu entry?
Thanks
RSH
_________________ Useful Software for Puppy!
LazY Puppy - a Paradise Puppy! - DE & EN ISO 2.0.2-0.0.5 available
|
|
Back to top
|
|
 |
01micko

Joined: 11 Oct 2008 Posts: 7019 Location: qld
|
Posted: Thu 13 Sep 2012, 19:46 Post subject:
|
|
This example should do what you want.
_________________ keep the faith .. 
|
|
Back to top
|
|
 |
RSH

Joined: 05 Sep 2011 Posts: 1564 Location: Germany
|
Posted: Thu 13 Sep 2012, 22:55 Post subject:
|
|
Thanks. Got it working.
Is there any documentation for C language and especially the gcc syntax available?
_________________ Useful Software for Puppy!
LazY Puppy - a Paradise Puppy! - DE & EN ISO 2.0.2-0.0.5 available
|
|
Back to top
|
|
 |
technosaurus

Joined: 18 May 2008 Posts: 3843
|
Posted: Fri 14 Sep 2012, 09:22 Post subject:
|
|
I used a more unix-ian philosophy for sit. I figured we could use gtkdialog (or Bacon, tk, xdialog, yad, getgui, xmessage, 9menu, pygtk,...) for the left and right click menus. Since the tray icon updates itself whenever the icon file changes, a gtkdialog program only needs to update the icon (with freedom to do whatever else). The only catch is it is useful for the dialog tool to have a "near mouse" option (most do). It _should_ greatly simplify the necessary logic for building any quick and dirty tray app (its basically gtrayicon on steroids, except public domain / any OSI licensed)
_________________ Puppy Web Desktop Now with pet packages - Pet Packaging 100 & 101
|
|
Back to top
|
|
 |
RSH

Joined: 05 Sep 2011 Posts: 1564 Location: Germany
|
Posted: Fri 14 Sep 2012, 20:44 Post subject:
|
|
@technosaurus
What do you mean? Your program sit?
Meanwhile i've made some work on this.
Created a Taskbar Menu containing default applications with default icons as menu entries like i've added to the wbar
This menu shows up if left-clicked on the tray icon. If i do right-click on the tray icon, it shows up the openbox menu, which is started through a little script. The script itself calls xdotool using "key ctrl+alt+w" as parameter.
| Code: | #!/bin/sh
sleep .15
/usr/bin/xdotool key ctrl+alt+w &
exit 0
|
This has been set earlier in /root/.config/openbox/rc.xml to be able to run the openbox menu from keyboard.
| Code: | <keybind key="C-A-w">
<action name="ShowMenu">
<menu>root-menu</menu>
</action>
</keybind>
|
That's pretty cool!
Compiled C Code binary runs a bash script that runs a binary that executes a keyboard shortcut defined in an .xml file!
It's quite familiar to playing in a band - but: me one is playing all instruments!
_________________ Useful Software for Puppy!
LazY Puppy - a Paradise Puppy! - DE & EN ISO 2.0.2-0.0.5 available
|
|
Back to top
|
|
 |
technosaurus

Joined: 18 May 2008 Posts: 3843
|
Posted: Fri 14 Sep 2012, 21:58 Post subject:
|
|
Seaside posted a link to it in your other tray app thread (I thought this was the same thread when I poste), but here is the link
http://murga-linux.com/puppy/viewtopic.php?t=76431
I'd say the only thing it may be missing at this point is to check args and image file existences (right now it expects that to already be done externally)
_________________ Puppy Web Desktop Now with pet packages - Pet Packaging 100 & 101
|
|
Back to top
|
|
 |
|