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 Tue 21 Oct 2014, 02:13
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 [6 Posts]  
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?
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

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


Joined: 11 Oct 2008
Posts: 7831
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 poster's 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 from previous:   Sort by:   
Page 1 of 1 [6 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0533s ][ Queries: 11 (0.0034s) ][ GZIP on ]