ereader gtk library - GtkBusyDialog widget for ereader system More...
#include <gtk/gtk.h>
#include "ergtk_log.h"
#include "ergtkbusydialog.h"
Go to the source code of this file.
Functions | |
static void | ergtk_busy_dialog_class_init (erGtkBusyDialogClass *klass) |
static void | ergtk_busy_dialog_init (erGtkBusyDialog *dialog) |
GtkWidget * | ergtk_busy_dialog_new (const gchar *label_text) |
ereader gtk library - GtkBusyDialog widget for ereader system
Definition in file ergtkbusydialog.c.
static void ergtk_busy_dialog_class_init | ( | erGtkBusyDialogClass * | klass | ) | [static] |
Copyright (C) 2008 iRex Technologies B.V. All rights reserved.
Definition at line 41 of file ergtkbusydialog.c.
static void ergtk_busy_dialog_init | ( | erGtkBusyDialog * | dialog | ) | [static] |
Definition at line 48 of file ergtkbusydialog.c.
References ERGTK_IS_BUSY_DIALOG, _erGtkBusyDialog::image, and _erGtkBusyDialog::label.
00049 { 00050 // GtkDialog *parent = (GtkDialog *) dialog; 00051 GtkWidget *vbox; 00052 GtkWidget *eventbox; 00053 GdkPixbuf *pixbuf; 00054 00055 g_return_if_fail(ERGTK_IS_BUSY_DIALOG(dialog)); 00056 00057 // window settings 00058 gtk_window_set_destroy_with_parent (GTK_WINDOW (dialog), TRUE); 00059 gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE); 00060 gtk_window_set_title (GTK_WINDOW (dialog), ""); 00061 gtk_window_set_skip_taskbar_hint (GTK_WINDOW (dialog), TRUE); 00062 gtk_window_set_decorated(GTK_WINDOW (dialog), FALSE); 00063 gtk_window_set_accept_focus(GTK_WINDOW(dialog), FALSE); 00064 gtk_widget_realize(GTK_WIDGET(dialog)); 00065 gdk_window_set_decorations(GTK_WIDGET(dialog)->window, GDK_DECOR_BORDER); 00066 00067 // Put the window in the center of its parent. 00068 gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER_ON_PARENT); 00069 00070 // container settings 00071 gtk_dialog_set_has_separator (GTK_DIALOG(dialog), FALSE); 00072 gtk_container_set_border_width (GTK_CONTAINER (dialog), 5); 00073 gtk_box_set_spacing (GTK_BOX (GTK_DIALOG(dialog)->vbox), 2); 00074 gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG(dialog)->action_area), 5); 00075 00076 // vbox 00077 // | 00078 vbox = gtk_vbox_new (FALSE, 12); 00079 gtk_container_set_border_width (GTK_CONTAINER (vbox), 5); 00080 gtk_box_pack_start (GTK_BOX (GTK_DIALOG(dialog)->vbox), vbox, TRUE, TRUE, 0); 00081 gtk_widget_show(vbox); 00082 00083 // |-- pixbuf image 00084 // | 00085 pixbuf = gtk_icon_theme_load_icon(gtk_icon_theme_get_default(), "dialog-busy", 48, 0, NULL); 00086 dialog->image = gtk_image_new_from_pixbuf(pixbuf); 00087 gtk_box_pack_start (GTK_BOX (vbox), dialog->image, FALSE, FALSE, 25); 00088 gtk_widget_show(dialog->image); 00089 00090 // |-- eventbox (spacer) 00091 // | 00092 eventbox = gtk_event_box_new(); 00093 gtk_widget_set_size_request(eventbox, 400, 1); 00094 gtk_box_pack_start (GTK_BOX (vbox), eventbox, FALSE, FALSE, 0); 00095 gtk_widget_show(eventbox); 00096 00097 // |-- label text 00098 // 00099 dialog->label = gtk_label_new (NULL); 00100 gtk_label_set_line_wrap (GTK_LABEL (dialog->label), FALSE); 00101 gtk_label_set_selectable (GTK_LABEL (dialog->label), FALSE); 00102 gtk_label_set_justify (GTK_LABEL (dialog->label), GTK_JUSTIFY_CENTER); 00103 gtk_box_pack_start (GTK_BOX (vbox), dialog->label, FALSE, FALSE, 0); 00104 gtk_widget_show(dialog->label); 00105 }
GtkWidget* ergtk_busy_dialog_new | ( | const gchar * | label_text | ) |
Definition at line 108 of file ergtkbusydialog.c.
References ERGTK_TYPE_BUSY_DIALOG, _erGtkBusyDialog::label, and LOGPRINTF.
Referenced by create_show_busy_loading(), and dialog_wait_show().
00109 { 00110 erGtkBusyDialog *dialog; 00111 00112 LOGPRINTF("entry"); 00113 00114 dialog = g_object_new (ERGTK_TYPE_BUSY_DIALOG, NULL); 00115 00116 if (label_text) 00117 { 00118 gtk_label_set_text (GTK_LABEL (dialog->label), label_text); 00119 } 00120 00121 return GTK_WIDGET (dialog); 00122 }