Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Fri 31 Oct 2014, 02:23
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
C Language - Icon for right-click menu in C?
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 1 Posts_count  
Author Message
RSH


Joined: 05 Sep 2011
Posts: 2420
Location: Germany

PostPosted: Wed 12 Sep 2012, 17:54    Post_subject:  C Language - Icon for right-click menu in C?
Sub_title: ? ? ?
 

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

_________________
LazY Puppy
RSH's DNA
SARA B.
Back to top
View user's profile Send_private_message 
01micko


Joined: 11 Oct 2008
Posts: 7840
Location: qld

PostPosted: Thu 13 Sep 2012, 19:46    Post_subject:  

This example should do what you want.
_________________
Woof Mailing List | keep the faith Cool |
Back to top
View user's profile Send_private_message Visit_website 
RSH


Joined: 05 Sep 2011
Posts: 2420
Location: Germany

PostPosted: Thu 13 Sep 2012, 22:55    Post_subject:  

01micko wrote:
This example should do what you want.

Thanks. Got it working. Very Happy



Is there any documentation for C language and especially the gcc syntax available?

_________________
LazY Puppy
RSH's DNA
SARA B.
Back to top
View user's profile Send_private_message 
technosaurus


Joined: 18 May 2008
Posts: 4353

PostPosted: 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)
_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send_private_message 
RSH


Joined: 05 Sep 2011
Posts: 2420
Location: Germany

PostPosted: 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! 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! Laughing Very Happy Cool

_________________
LazY Puppy
RSH's DNA
SARA B.
Back to top
View user's profile Send_private_message 
technosaurus


Joined: 18 May 2008
Posts: 4353

PostPosted: 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)

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Off-Topic Area » Programming
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0968s ][ Queries: 12 (0.0464s) ][ GZIP on ]