Possible Bug in gtk+ Boxes



Either there is a bug here or I'm missing something in my code.

Before we start, the entire code is available for review at
https://www.freedom-it.com/clinical.tgz

I'm working with this gtk+ program with a few boxes packed in boxes.

I'm trying to adjust how it looks at this point and discovered that when I create horizontal boxes for rows of output, that I create as needed and then
pack into a verticle box.

When I create the horizontal box with homogenous set up, it sets up past the end of the top level bo, almost like it is getting its available size information
from the size of the entrie X screen at max.

Here is the code snippet from front.c


gtk_container_foreach(GTK_CONTAINER(drug_h_box),destroy_children, NULL);
        //g_print("Hello We are in insert_drug_levels");

level_v_box = gtk_vbox_new(FALSE,0); //Contains all the rows gtk_box_pack_start(GTK_BOX(drug_h_box),level_v_box,FALSE,FALSE,3); if(!strcmp(drugs.creatinine,"ON")){
                row = gtk_hbox_new(FALSE,0);
                label=gtk_label_new("Creatinine Serum Level");
gtk_box_pack_start(GTK_BOX(level_v_box),row,FALSE,FALSE,3); /* Need to Add Another Verticle Box Here */
                creatinine_data_box = gtk_vbox_new(FALSE,0);
gtk_box_pack_start(GTK_BOX(row),creatinine_data_box,FALSE,FALSE,3);

gtk_box_pack_start(GTK_BOX(creatinine_data_box),label,FALSE,FALSE,3);
                gtk_widget_show(label);
                level=gtk_entry_new();
                gtk_entry_set_max_length(GTK_ENTRY(level), 3);
gtk_box_pack_start(GTK_BOX(creatinine_data_box),level,FALSE,FALSE,3);
                gtk_widget_show(level);
/* Make a spin button - what a PIA this widget is */
                creatinine_date_box = gtk_vbox_new(FALSE,0);
                label2=gtk_label_new("Time and Date Taken");
gtk_box_pack_start(GTK_BOX(creatinine_date_box),label2,FALSE,FALSE,3);
                gtk_widget_show(label2);
                creatinine_date_inner_box = gtk_hbox_new(FALSE,0);
                creatinine_day_box = gtk_vbox_new(FALSE,0);
                creatinine_month_box = gtk_vbox_new(FALSE,0);
                creatinine_year_box = gtk_vbox_new(FALSE,0);
                creatinine_hour_box = gtk_vbox_new(FALSE,0);
                creatinine_minute_box = gtk_vbox_new(FALSE,0);

gtk_box_pack_start(GTK_BOX(row),creatinine_date_box,FALSE,FALSE,0); gtk_box_pack_start(GTK_BOX(creatinine_date_box),creatinine_date_inner_box,FALSE,FALSE,0); gtk_box_pack_start(GTK_BOX(creatinine_date_inner_box),creatinine_day_box,FALSE,FALSE,0); gtk_box_pack_start(GTK_BOX(creatinine_date_inner_box),creatinine_month_box,FALSE,FALSE,0); gtk_box_pack_start(GTK_BOX(creatinine_date_inner_box),creatinine_year_box,FALSE,FALSE,0); gtk_box_pack_start(GTK_BOX(creatinine_date_inner_box),creatinine_hour_box,FALSE,FALSE,0); gtk_box_pack_start(GTK_BOX(creatinine_date_inner_box),creatinine_minute_box,FALSE,FALSE,0);



The widget row is the problem.  When I change the line
row = gtk_hbox_new(FALSE,0);

to

row = gtk_hbox_new(TRUE,0);

It expands right off the page....

No good!

Comments which are helpful are welcome.

Ruben




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]