Layout will not show unless I literally resize the screen?

I am working on adding an additional feature to a program that models a product by default in 2D. The user can then press F12 to open another window which shows the product in 3D using OpenGL. The program is written in C using GTK 3.0.

I can’t really provide code examples because there is no minimal example that will help. I would need to provide thousands of lines to show the process of creating buttons, displaying them, giving them event handlers, etc.

So with that, I will try my best to describe what is happening and then I am just hoping that someone can point me in the right direction because I have been trying different things for weeks now and I cannot understand what is happening.

So, when the user hits F12 it runs a “start” function for the 3D version of the program. Here it creates a new window, new layouts, adds events, etc.

The problem was, when the user closed the window, and loaded a new model from the 2D modeling window, the model was not loaded into the 3D program because it was not built to handle that (I did not develop this part of the application). So my job has been to correctly clean up the 3D application when the user hits F12 and reset all state variables so that when it is re-opened it is re-initialized with the new model data.

Everything is working fine except the buttons that are attached to a layout do not show up UNLESS I resize the screen in any way. However, if I call gtk_widget_queue_resize it does not show the buttons. I have tried debugging by printing messages and even using gdb and I cant find any discrepancies between the two runs of the 3D program. If anyone has any ideas of what could be happening here I would greatly appreciate it. Thanks.

Update:

If I change the size_request and default_size by any amount each run it shows the layout. But still doesnt solve the issue if the program runs in fullscreen mode.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.