gtk_box_pack_start: assertion `GTK_IS_BOX (box)' failed
- From: "Divya yadav" <divyayadav gtk gmail com>
- To: gtk-app-devel-list gnome org
- Subject: gtk_box_pack_start: assertion `GTK_IS_BOX (box)' failed
- Date: Tue, 3 Jul 2007 13:04:28 +0530
Hello everyone..
I am trying the foolowing code but its giving warning saying.. Please where
am I going wrong
(<unknown>:1344): Gtk-CRITICAL **: gtk_box_pack_start: assertion `GTK_IS_BOX
(box)' failed
(<unknown>:1344): Gtk-CRITICAL **: gtk_box_pack_start: assertion `GTK_IS_BOX
(box)' failed
(<unknown>:1344): Gtk-CRITICAL **: gtk_box_pack_start: assertion `GTK_IS_BOX
(box)' failed
gboolean
app_create_progress_window(bt_app_ui_state_t* this, bt_int8_t*
progress_window_title, bt_int8_t* file_name)
{
gint response, width, height;
if(this->progress_window != NULL)
{
// progress bar window was not destroyed properly last time
bt_app_destroy_progress_window(this);
}
// create a dialog box
this->progress_window = gtk_dialog_new(progress_window_title);
// Add label only if file_name exists. otherwise, skip this widget
if(file_name != NULL)
{
GtkWidget* file_name_label;
file_name_label = gtk_label_new (file_name);
gtk_misc_set_alignment (GTK_MISC (file_name_label), 0, 0.5);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG
(this->progress_window)->action_area),file_name_label, FALSE, FALSE, 0);
gtk_widget_show (file_name_label);
gtk_dialog_add_widget ((GtkDialog
*)this->progress_window,file_name_label);
}
// Add percentage counter
this->progress_counter = gtk_label_new ("0%");
gtk_misc_set_alignment (GTK_MISC (this->progress_counter), 1, 0);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG
(this->progress_window)->action_area),this->progress_counter, FALSE, FALSE,
0);
gtk_widget_show (this->progress_counter);
gtk_dialog_add_widget ((GtkDialog
*)this->progress_window,this->progress_counter);
// Add progressbar to dialog box
this->progress_bar = gtk_progress_bar_new ();
gtk_widget_set_size_request (GTK_WIDGET (this->progress_bar), -1, 10);
gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (this->progress_bar), 0);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG
(this->progress_window)->action_area),this->progress_bar, FALSE, FALSE, 0);
gtk_widget_show (this->progress_bar);
gtk_dialog_add_widget ((GtkDialog
*)this->progress_window,this->progress_bar);
if(this->progress_window == NULL)
{
// window doesn't exist. nothing to show
return FALSE;
}
// window was created. just show the window
gtk_window_get_size(GTK_WINDOW(this->progress_window), &width, &height);
gtk_window_move(GTK_WINDOW(this->progress_window), 0,
BT_MAIN_LCD_H-height);
gtk_window_activate_default(GTK_WINDOW(this->progress_window));
gtk_window_present(GTK_WINDOW(this->progress_window));
return TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]