- DVD Review: Style overshadows heart in spunky comedy SPORK
- J.J. Abrams sells new apocalypse show that sounds like the Emberverse series
- Review of quiescent arthouse gangster film The Road to Nod
- Android zen and zombie love in teaser for DOOMSDAY BOOK
- Android zen and zombie love in teaser for DOOMSDAY BOOK
- Android zen and zombie love in teaser for DOOMSDAY BOOK
- Zombie bigots abound in DAVE OF THE DEAD
- J.J. Abrams sells new apocalypse show that sounds like the Emberverse series
- J.J. Abrams sells new apocalypse show that sounds like the Emberverse series
- J.J. Abrams sells new apocalypse show that sounds like the Emberverse series
- Female Prisoner No. 701: Sasori
- Re: Japanese zombie movies (2011-12 round-up)
- Re: Life Is Dead
- Balkans war revenge movie - Nicolas Cage?
- PA Film Archive
- i kill
- Re: Life Is Dead
- Monster Killer
- zombie films
- Re: Life Is Dead
- APOCALYPSE PIZZA VIDEO delivers during the zombie apocalypse!
- Concept art for Enki Bilal's next is PA animation ANIMAL'Z
- Trailer for ZOMBIE MURDER EXPLOSION DIE! All 4 of these in every episode!
- Wandering madly in the remnants of civilization in Greece's HIGUITA (teaser)
- THE HOST director's English language debut SNOW PIERCER adds cast
- Argentina invaded by NEWMEDIA aliens
- THE DIVIDE movie review
- THE RIDER still rides! New teaser reveals stunning final animation style
- EXCLUSIVE: Trailer for RAMPAGE IN HEAVEN sees The Monkey King and mech in a nightmarish dying world
- Sony could back Seth Rogan's THE APOCALYPSE (Jay and Seth vs. The Apocalypse)
- Russia's snowed under with zombies in WINTER OF THE DEAD
- SLAMDANCE 2012: Review of killer tattoo thriller COMFORTING SKIN
- DVD Review: Style overshadows heart in spunky comedy SPORK
- DVD Review: Daniel Craig loses his mind in mediocre DREAM HOUSE
- SUNDANCE 2012: Review of EXCISION
- SUNDANCE 2012: Review of THE PACT
- SUNDANCE 2012: Review of GRABBERS
- SUNDANCE 2012: Review of SAFETY NOT GUARANTEED
- SUNDANCE 2012: Review of the visionary BEASTS OF THE SOUTHERN WILD
- SUNDANCE 2012: Review of (Radio Shack) ROBOT AND FRANK
- SLAMDANCE 2012: Review of unimpressive UNCONDITIONAL
- Will you see this film? Teaser poster for RESIDENT EVIL: RETRIBUTION
- DVD Review: Style overshadows heart in spunky comedy SPORK
- DVD Review: Daniel Craig loses his mind in mediocre DREAM HOUSE
- Zombie bigots abound in DAVE OF THE DEAD
- Douche bags are target practice in GOD BLESS AMERICA trailer
- SUNDANCE 2012: Review of EXCISION
- SUNDANCE 2012: Review of THE PACT
- SUNDANCE 2012: Review of GRABBERS
- EXCLUSIVE: Researching life after death in random data patterns in APOPHENIA (APOFANIA) (trailer)
- Willem Dafoe is THE HUNTER
- SUNDANCE 2012: Review of SAFETY NOT GUARANTEED
- THE WALKING DEAD teases a dire, breakneck return
- A Panda protects the innocent in WASTLANDER PANDA tv series
- Full Moon jumps on the Nazi train with PUPPET MASTER X: AXIS RISING
- SUNDANCE 2012: Review of the visionary BEASTS OF THE SOUTHERN WILD
- SUNDANCE 2012: Review of (Radio Shack) ROBOT AND FRANK
- Monty Python reunite for scifi comedy ABSOLUTELY ANYTHING
- Creature with cow tail lures men to their death in THALE (trailer)
- SLAMDANCE 2012: Review of unimpressive UNCONDITIONAL
- Seventeen and a robotic teddy bear for a best friend in ANIMALS (trailer)
Jack In
Latest Comments
Latest Forum Posts
PA News
Latest Reviews
Older News
Film Festivals
Berlin International Film Festival (Berlinale)
Feb 09 - Feb 19
Berlin, Germany
Boston Underground Film Festival
Mar 24 - Mar 31
Boston, Massacheusets
Yubari International Fantastic Film Festival
Feb 23 - Feb 27
Yūbari, Hokkaidō, Japan
Cinequest Film Festival
Feb 28 - Mar 11
San Jose, California
South by Southwest (SXSW)
Mar 09 - Mar 17
Austin, Texas
Staff
Don Neumann aka quietearth
Editor in Chief
Fort Collins/Denver, Colorado
agentorange
Managing Editor
Edmonton, Alberta
Marina Antunes
Assistant Managing Editor
Vancouver, British Columbia
projectcyclops
UK Correspondent
Edinburgh, Scotland
Rick McGrath
Toronto Correspondent
Toronto, Ontario
The Crystal Ferret
France Correspondent
Paris, France
rochefort
Austin Correspondent
Austin, Texas
kilowog
LA Correspondent
Los Angeles, California
Joao Fleck
South American Correspondent
Porto Alegre, Brazil
quietearth [General News 01.23.07]
First off we need the egg tray source written by Anders Carlsson which is widely used. This just contains one C file and a header file:
http://www.quietearth.us/src/eggtrayicon.tar.gz
Next we setup the headers for our main file, main.c:
#include <stdio.h>
#include <gtk/gtk.h>
#include "eggtrayicon.h"and then declare the necessary variables for our docklet:
static EggTrayIcon *docklet = NULL;
GtkWidget *box;And now we can setup some event call backs, depending on which mouse button you push you wsill get a different result:
void docklet_button_press(GtkWidget *button, GdkEventButton *event, void *data)
{
if (event->type != GDK_BUTTON_PRESS) return;
switch (event->button) {
case 1:
printf("egg tray button 1\n");
break;
case 2:
printf("egg tray button 2\n");
break;
case 3:
printf("egg tray button 3\n");
break;
}
}Now we add in our little docklet_init routine so we can get the panel up and running. You might need to change the path of the png icon used.
docklet_init()
{
GtkWidget *image;
docklet = egg_tray_icon_new("Bluetooth");
box = gtk_event_box_new();
#if GTK_MINOR_VERSION >= 6
image = gtk_image_new_from_icon_name ("stock_bluetooth", GTK_ICON_SIZE_BUTTON);
#else
image = gtk_image_new_from_file ("/usr/share/icons/gnome/24x24/stock/io/stock_bluetooth.png");
#endif
/* the box container is so we can add callbacks events */
gtk_container_add(GTK_CONTAINER(box), image);
gtk_container_add(GTK_CONTAINER(docklet), box);
if(!gtk_check_version(2,4,0))
g_object_set(G_OBJECT(box), "visible-window", FALSE, NULL);
/* callbacks */
g_signal_connect(G_OBJECT(box), "button-press-event", G_CALLBACK(docklet_button_
press), NULL);
gtk_widget_show_all(GTK_WIDGET(docklet));
}And now simply main()
main(int argc, char *argv[])
{
gtk_set_locale();
gtk_init(&argc, &argv);
docklet_init();
gtk_main();
}Now lets compile:
# gcc `pkg-config --cflags gtk+-2.0` -c main.c
# gcc `pkg-config --cflags gtk+-2.0` -c eggtrayicon.c
# gcc `pkg-config --cflags --libs gtk+-2.0` main.o eggtrayicon.o -o mainNow just run this from any xterm and hit any mouse button on the applet which showed upt, and it will tell you which button you pushed.
Andrew Ruthven (4 years ago) Reply
Hey, nice intro. Just a heads for people that there are a few typos in there (in the case block), but gcc will point them out pretty quickly.
Thanks!
quietearth (4 years ago) Reply
Thanks for pointing that out, I fixed it.
Andrew Ruthven (4 years ago) Reply
No worries, you still have prihnt in there. :)
quietearth (4 years ago) Reply
aaaaghh!!! I fixed that too, anything else I'm missing?
Kim Johansen (4 years ago) Reply
Thanks for a great guide!
firecracker (3 years ago) Reply
thanks for the quick and easy guide :)
jypark (2 years ago) Reply
Thanks for the best guide!
JasonWoof (2 years ago) Reply
Thank you! thank you!
From this tutorial, I learned about eggtrayicon, and how to use it.
I made a little program that displays the contents of a text file in the notification area (checks for updates every second)
http://gitorious.org/jasonwoof/now-playing-d
glowhand (1 year ago) Reply
Funktioniert leider nicht:
ain.o: In function `main':
main.c:(.text+0x21): undefined reference to `docklet_init'
collect2: ld returned 1 exit status



