gnome gtk system-tray in C

2010-02-16 08:18:32 by ed_mann in Open Source 0 comments

I was looking for a simple tutorial on how to make system tray icon in C. Well i found this page and tried the example. Just needed to add <gtk/gtk.h> to the include and it compiled and worked just fine. I am adding it here so

  1.  it's easier for me to find when i actually need it again,
  2. sites tend to disappear on the net, so this is my backup copy.

#include <gtk/gtk.h>

void tray_icon_on_click(GtkStatusIcon *status_icon,
                        gpointer user_data)
{
        printf("Clicked on tray icon\n");
}

void tray_icon_on_menu(GtkStatusIcon *status_icon, guint button,
                       guint activate_time, gpointer user_data)
{
        printf("Popup menu\n");
}

static GtkStatusIcon *create_tray_icon() {
        GtkStatusIcon *tray_icon;

        tray_icon = gtk_status_icon_new();
        g_signal_connect(G_OBJECT(tray_icon), "activate",
                         G_CALLBACK(tray_icon_on_click), NULL);
        g_signal_connect(G_OBJECT(tray_icon),
                         "popup-menu",
                         G_CALLBACK(tray_icon_on_menu), NULL);
        gtk_status_icon_set_from_icon_name(tray_icon,
                                           GTK_STOCK_MEDIA_STOP);
        gtk_status_icon_set_tooltip(tray_icon,
                                    "Example Tray Icon");
        gtk_status_icon_set_visible(tray_icon, TRUE);

        return tray_icon;
}

int main(int argc, char **argv) {
        GtkStatusIcon *tray_icon;

        gtk_init(&argc, &argv);
        tray_icon = create_tray_icon();
        gtk_main();

        return 0;
}

Continue Reading 'gnome gtk system-tray in C' »

Oracle PDO_OCI PHP install fedora CentOS

2009-10-08 13:09:32 by ed_mann in Computers & Technology 3 comments
Well i run a mix of CentOS and Fedora machines, and at work i needed to run some reports from an Oracle DB. I really don't care much for Oracle, but i needed to get the data, and since i don't like having to do the same thing over again i thought i would just throw together a PHP page and let the user run the canned report themselves. However getting Oracle to install on CentOS and my Fedora boxes was not a simple yum install...

Continue Reading 'Oracle PDO_OCI PHP install fedora CentOS' »

Take your best shot by Austin Gutwein and Todd Hillard

2009-10-04 14:43:29 by ed_mann in Reviews 1 comments
I heard the other day that there are two things you are remembered for 1. The problems you create, 2. The problems you solve. I want to be a part of the team that solves problems. As i was reading this book i knew Austin is one of the people that solves problems. He saw a problem and used what he could to help address that problem. In the book Take your best shot, Austin does not sugar coat it at all, the highlights, struggles and challenges are written about as well.

Continue Reading 'Take your best shot by Austin Gutwein and Todd Hillard' »

What Difference Do It Make? By Ron Hall, Denver Moore and Lynn Vincent

2009-09-21 20:13:38 by ed_mann in Reviews 0 comments
A part of the book that got me thinking was the time when Ron judged Jose by his outward appearance. Denver then filled Ron in on the error of his judgement and gave him some history on Jose. I know i am guilty of judging people by their appearance. Where i go to church there have been many occasions that people have asked me for money. I remember this one time a guy gave me a story about how he ran out of gas and his wife was in the car. He was limping around with a cane, and he just wanted some money to get some gas.

Continue Reading 'What Difference Do It Make? By Ron Hall, Denver Moore and Lynn Vincent' »

12 3 4 5 Next > >
 
This page took 0.188662 seconds to load.