static gboolean mailwatch_create(Control *c) { XfceMailwatchPlugin *mwp = g_new0(XfceMailwatchPlugin, 1); c->data = mwp; mwp->mailwatch = xfce_mailwatch_new(); if(G_UNLIKELY(!mwp->mailwatch)) { xfce_message_dialog(NULL, _("Xfce Mailwatch"), GTK_STOCK_DIALOG_ERROR, _("The mailwatch applet cannot be added to the panel."), _("It is possible that your version of GLib does not have threads support."), GTK_STOCK_CLOSE, GTK_RESPONSE_ACCEPT, NULL); g_free(mwp); return FALSE; } mwp->tooltip = gtk_tooltips_new(); mwp->button = gtk_button_new(); gtk_button_set_relief(GTK_BUTTON(mwp->button), GTK_RELIEF_NONE); gtk_widget_show(mwp->button); gtk_container_add(GTK_CONTAINER(c->base), mwp->button); g_signal_connect(mwp->button, "button-press-event", G_CALLBACK(mailwatch_button_press_cb), mwp); g_signal_connect(mwp->button, "button-release-event", G_CALLBACK(mailwatch_button_release_cb), mwp); gtk_tooltips_set_tip(mwp->tooltip, mwp->button, _("No new mail"), NULL); mwp->image = xfce_scaled_image_new(); gtk_widget_show(mwp->image); gtk_container_add(GTK_CONTAINER(mwp->button), mwp->image); mwp->loglist = gtk_list_store_new(LOGLIST_N_COLUMNS, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING ); xfce_mailwatch_signal_connect(mwp->mailwatch, XFCE_MAILWATCH_SIGNAL_NEW_MESSAGE_COUNT_CHANGED, mailwatch_new_messages_changed_cb, mwp); xfce_mailwatch_signal_connect( mwp->mailwatch, XFCE_MAILWATCH_SIGNAL_LOG_MESSAGE, mailwatch_log_message_cb, mwp); xfce_mailwatch_force_update(mwp->mailwatch); return TRUE; }
static void xfce_image_list_dialog_init(XfceImageListDialog *aXfceImageListDialog) { XfceImageListDialogPrivate *priv; priv = g_new0(XfceImageListDialogPrivate, 1); aXfceImageListDialog->priv = priv; priv->listbox = xfce_image_list_box_new (); priv->image_label = GTK_LABEL (gtk_label_new ("")); gtk_widget_show (GTK_WIDGET (priv->image_label)); priv->image = XFCE_SCALED_IMAGE (xfce_scaled_image_new ()); gtk_widget_set_size_request (GTK_WIDGET (priv->image), 400, 400); priv->image_box = GTK_BOX (gtk_vbox_new (FALSE, 7)); gtk_container_set_border_width (GTK_CONTAINER (priv->image_box), 5); gtk_box_pack_start (GTK_BOX (priv->image_box), GTK_WIDGET (priv->image_label), FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (priv->image_box), GTK_WIDGET (priv->image), FALSE, FALSE, 0); gtk_widget_show_all (GTK_WIDGET (priv->image_box)); gtk_widget_show (GTK_WIDGET (priv->listbox)); priv->paned = GTK_PANED (gtk_hpaned_new ()); gtk_paned_pack1 (priv->paned, GTK_WIDGET (priv->listbox), TRUE, TRUE); gtk_paned_pack2 (priv->paned, GTK_WIDGET (priv->image_box), TRUE, TRUE); gtk_widget_show (GTK_WIDGET (priv->paned)); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (aXfceImageListDialog)->vbox), GTK_WIDGET (priv->paned), TRUE, TRUE, 0); gtk_dialog_add_button (GTK_DIALOG (aXfceImageListDialog), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL); priv->ok_button = GTK_BUTTON (gtk_dialog_add_button (GTK_DIALOG (aXfceImageListDialog), GTK_STOCK_OK, GTK_RESPONSE_OK)); gtk_dialog_set_default_response (GTK_DIALOG (aXfceImageListDialog), GTK_RESPONSE_CANCEL); gtk_widget_set_sensitive (GTK_WIDGET (priv->ok_button), FALSE); g_signal_connect (G_OBJECT (priv->listbox), "selection-changed", G_CALLBACK (xfce_image_list_dialog_selection_changed_cb), aXfceImageListDialog); g_signal_connect (G_OBJECT (priv->listbox), "notify::changed", G_CALLBACK (xfce_image_list_dialog_notify_changed_cb), aXfceImageListDialog); g_signal_connect (G_OBJECT (priv->listbox), "notify::filename", G_CALLBACK (xfce_image_list_dialog_notify_fname_changed_cb), aXfceImageListDialog); g_signal_connect (G_OBJECT (priv->ok_button), "clicked", G_CALLBACK (xfce_image_list_dialog_ok_button_clicked_cb), aXfceImageListDialog); }