Well, I have a problem with the small interface that I am doing in GTK.
I have some widgets in the field, exactly three widgets, and I put them in a vbox with gtk_box_pack_start . I resized these widgets using the gtk_widget_set_size_request function, but it does not seem to take effect since the widgets expand to the total vbox width and do not take into account the size that I fixed in the function.
The piece of code that does this:
enter = gtk_button_new(); gtk_button_set_image(GTK_BUTTON(enter), gtk_image_new_from_file("iconos/submit.png")); gtk_widget_set_size_request(enter, 195, 32); //User,pass login->user = gtk_entry_new(); login->passwd = gtk_entry_new(); gtk_widget_set_size_request(login->user, 195, 32); gtk_widget_set_size_request(login->passwd, 195, 32); gtk_box_pack_start(GTK_BOX(v_box), login->user, FALSE, FALSE, 10); gtk_box_pack_start(GTK_BOX(v_box), login->passwd, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(v_box), enter, FALSE, FALSE, 10); gtk_container_add(GTK_CONTAINER(window), v_box);
If I put these widgets in alignment, I have no problems, the size is fixed correctly.
Why is this?
Leber source share