How to create special toolbar buttons
- From: Jan Dittberner <jan jan-dittberner de>
- To: Gnome Developer Mailing List <gnome-devel-list gnome org>
- Subject: How to create special toolbar buttons
- Date: Tue, 20 Jun 2000 14:44:41 +0200
I want to create a list of toolbar buttons with
a common callback function and different int values
as the user_data field. I tried this:
--8<-------
#define GMTV_PLAY 1
#define GMTV_STOP 2
static GnomeUIInfo main_toolbar[] = {
{
GNOME_APP_UI_ITEM, NULL, N_("Start playing the movie"),
gmtv_player_command_cb, GINT_TO_POINTER(GMTV_PLAY), NULL,
GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_PIXMAP_FORWARD,
'p', GDK_CONTROL_MASK
},
{
GNOME_APP_UI_ITEM, NULL, N_("Stop playing the movie"),
gmtv_player_command_cb, GINT_TO_POINTER(GMTV_STOP), NULL,
GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_PIXMAP_STOP,
's', GDK_CONTROL_MASK
}
}
--8<-------
and the callback function now should switch based
on the user_data field. I called GPOINTER_TO_INT(data),
but it seems to be a pointer (to my app object I guess)
Is there a possibility to create such buttons with stock
Icons?
Jan Dittberner
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]