oh ok,
My problem is that I don't really understand whats happens when I use the command "pack_start"
Here is my code:
1) I read the new values from a variable that has been set in another task
2) I put them in a labelfield
3) I align them
4) I put the widgets in the boxes.
When the values are just changed, what should I do? Just remake the points 1 to 3 and then gtk_widget_show_all?
Can you give me an example How you would do it, if you use the same commands to fill the box "rm_local.widgets.vboxSpin"?
Thanks a lot!
MBoerner
Code:
static void rm_fill_box_stop_mode_spin(int stepnr)
{
char strlabelSpeed[50];
char strlabelAcc[50];
char strlabelTime[50];
GtkWidget* alignSpeed;
GtkWidget* alignAcc;
GtkWidget* alignTime;
// 1)set the current value of the speed, the acceleration and the ellapsed time
sprintf(strlabelSpeed, "%s:%5d/%5d",descr_editBuffer.step.spin.speed.description, 0 ,recipe_editBuffer.step[stepnr].spin.speed);
sprintf(strlabelAcc, "%s:%5d",descr_editBuffer.step.spin.acceleration.description, recipe_editBuffer.step[stepnr].spin.acceleration);
sprintf(strlabelTime, "%s:%5d/%5d",descr_editBuffer.step.spin.spintime.description, 0, recipe_editBuffer.step[stepnr].spin.spintime);
// 2)put the values in label fields
rm_local.widgets.lblSpinSpeed = gtk_label_new(strlabelSpeed);
rm_local.widgets.lblSpinAcc = gtk_label_new(strlabelAcc);
rm_local.widgets.lblSpinTime = gtk_label_new(strlabelTime);
// 3)align the fields
alignSpeed = gtk_alignment_new(0.0, 0.5, 0.0, 0.0);
gtk_container_add(GTK_CONTAINER(alignSpeed), rm_local.widgets.lblSpinSpeed);
alignAcc = gtk_alignment_new(0.0, 0.5, 0.0, 0.0);
gtk_container_add(GTK_CONTAINER(alignAcc), rm_local.widgets.lblSpinAcc);
alignTime = gtk_alignment_new(0.0, 0.5, 0.0, 0.0);
gtk_container_add(GTK_CONTAINER(alignTime), rm_local.widgets.lblSpinTime);
// 4)put them in the different boxes
gtk_box_pack_start (GTK_BOX (rm_local.widgets.vboxSpin), alignSpeed ,TRUE, TRUE, 5);
gtk_box_pack_start (GTK_BOX (rm_local.widgets.vboxSpin), alignAcc ,TRUE, TRUE, 5);
gtk_box_pack_start (GTK_BOX (rm_local.widgets.vboxSpin), alignTime ,TRUE, TRUE, 5);
gtk_label_set_justify(GTK_LABEL(rm_local.widgets.lblSpinSpeed), GTK_JUSTIFY_LEFT);
gtk_label_set_justify(GTK_LABEL(rm_local.widgets.lblSpinAcc), GTK_JUSTIFY_LEFT);
}
step