You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

95 lines
2.7 KiB

12 years ago
/*
12 years ago
* Copyright (C) 2006-2007 Jasper Huijsmans <jasper@xfce.org>
* Copyright (C) 2008-2009 Nick Schermer <nick@xfce.org>
12 years ago
*
* This library is free software; you can redistribute it and/or
12 years ago
* modify it under the terms of the GNU Lesser General Public
12 years ago
* License as published by the Free Software Foundation; either
12 years ago
* version 2.1 of the License, or (at your option) any later version.
12 years ago
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 years ago
* Lesser General Public License for more details.
12 years ago
*
12 years ago
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
12 years ago
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <libxfce4util/libxfce4util.h>
#include <gtk/gtk.h>
#include <libxfce4panel/xfce-panel-macros.h>
#include <libxfce4panel/xfce-panel-convenience.h>
#include <libxfce4panel/libxfce4panel-alias.h>
12 years ago
/**
* SECTION: convenience
* @title: Convenience Functions
* @short_description: Special purpose widgets and utilities
* @include: libxfce4panel/libxfce4panel.h
*
* This section describes a number of functions that were created
* to help developers of Xfce Panel plugins.
**/
12 years ago
/**
* xfce_panel_create_button:
12 years ago
*
* Create regular #GtkButton with a few properties set to be useful in the
* Xfce panel: Flat (%GTK_RELIEF_NONE), no focus on click and minimal padding.
*
* Returns: newly created #GtkButton.
**/
GtkWidget *
xfce_panel_create_button (void)
12 years ago
{
GtkWidget *button = gtk_button_new ();
GTK_WIDGET_UNSET_FLAGS (button, GTK_CAN_DEFAULT | GTK_CAN_FOCUS);
gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
gtk_button_set_focus_on_click (GTK_BUTTON (button), FALSE);
gtk_widget_set_name (button, "xfce_panel_button");
return button;
}
/**
* xfce_panel_create_toggle_button:
12 years ago
*
* Create regular #GtkToggleButton with a few properties set to be useful in
* Xfce panel: Flat (%GTK_RELIEF_NONE), no focus on click and minimal padding.
*
* Returns: newly created #GtkToggleButton.
**/
GtkWidget *
xfce_panel_create_toggle_button (void)
12 years ago
{
GtkWidget *button = gtk_toggle_button_new ();
GTK_WIDGET_UNSET_FLAGS (button, GTK_CAN_DEFAULT | GTK_CAN_FOCUS);
gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
gtk_button_set_focus_on_click (GTK_BUTTON (button), FALSE);
gtk_widget_set_name (button, "xfce_panel_toggle_button");
return button;
}
#define __XFCE_PANEL_CONVENIENCE_C__
#include <libxfce4panel/libxfce4panel-aliasdef.c>