logout.c 936 Bytes
Newer Older
1
/* logout.c - Panel applet to end current session.  */
2
/* Original author unknown. CORBAized by Elliot Lee */
3
/* uncorbized by George Lebl */
4

5
#include <config.h>
6 7
#include <gnome.h>
#include "panel.h"
8

9 10 11
static void
logout(void)
{
12
	panel_quit();
13 14
}

15
GtkWidget *
16
create_logout_widget(void)
17
{
18 19 20 21
	GtkWidget *button;
	GtkWidget *pixmap;
	char *pixmap_name;

22
	pixmap_name = gnome_unconditional_pixmap_file("gnome-term-night.png");
23 24 25 26 27 28 29 30 31

	if (!pixmap_name)
		button = gtk_button_new_with_label(_("Log out"));
	else {
		button = gtk_button_new();
		pixmap = gnome_pixmap_new_from_file(pixmap_name);
		g_free(pixmap_name);
		gtk_container_add(GTK_CONTAINER(button), pixmap);
		gtk_widget_show(pixmap);
32 33 34
		gtk_widget_set_usize(button, 48, 48);
		/*gtk_widget_set_usize(button, pixmap->requisition.width,
				     pixmap->requisition.height);*/
35 36
	}

37 38
	gtk_signal_connect(GTK_OBJECT(button), "clicked",
			   GTK_SIGNAL_FUNC(logout), NULL);
39 40

	return button;
41
}