How to create special toolbar buttons



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]