/** * add_workspaces: * @i3_workspaces: the workspaces plugin * * Add the workspaces. */ static void add_workspaces(i3WorkspacesPlugin *i3_workspaces) { GSList *wlist = i3wm_get_workspaces(i3_workspaces->i3wm); GSList *witem; for (witem = wlist; witem != NULL; witem = witem->next) { i3workspace *workspace = (i3workspace *) witem->data; if (workspace) { GtkWidget * button; button = xfce_panel_create_button(); gtk_button_set_label(GTK_BUTTON(button), workspace->name); set_button_label(button, workspace, i3_workspaces->config); g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(on_workspace_clicked), i3_workspaces); /* avoid acceleration key interference */ gtk_button_set_use_underline(GTK_BUTTON(button), FALSE); gtk_box_pack_end(GTK_BOX(i3_workspaces->hvbox), button, FALSE, FALSE, 0); gtk_widget_show(button); g_hash_table_insert(i3_workspaces->workspace_buttons, workspace, button); } } }
static ExitbuttonPlugin * exitbutton_new(XfcePanelPlugin *plugin) { /* allocate memory for the plugin structure */ ExitbuttonPlugin *exitbutton = g_slice_new0(ExitbuttonPlugin); /* pointer to plugin */ exitbutton->plugin = plugin; /* read the user settings */ exitbutton_read(exitbutton); /* some panel widgets */ exitbutton->button = xfce_panel_create_button(); gtk_widget_show(exitbutton->button); g_signal_connect(G_OBJECT(exitbutton->button), "clicked", G_CALLBACK(button_clicked), plugin); exitbutton->icon = xfce_panel_image_new_from_source(exo_str_is_empty (exitbutton->icon_name) ? DEFAULT_ICON_NAME : exitbutton->icon_name); gtk_widget_show(exitbutton->icon); gtk_container_add(GTK_CONTAINER(exitbutton->button), exitbutton->icon); return exitbutton; }