Button Sizing

From the manual, if we want to set the size of a button, it said set the size of button at the time of creation. It looks alright. However, if we follow the previous code, when we resize the frame, then the button will resize to the default size. In the following, it will just give the same problem.

Somebody would say I have not set the layout yet. You are right. But the problem would even worse if we set the button to the layout, you never see the button changed. When you run the program, you always see a default sized button. Since, when the you set the layout, the button will force to set back to the default size, example code 3

In this example 3, it tells us the frame size will also be changed after we the layout to fit the internal content size. As what i said, it will only give out a default size button. You will say that set the button size after setting the layout. You are right again. It works at the beginning. We can see a button with our intened size. But when we resize the frame, then the program will follow the layout setting, and do the automatic re-adjustment of the frame content, then button will then be set back to the default. It will give the same effect if we are using container.

People would ask "Then we can't have a button with the size we want by using wxHaskell". At the moment, it has a way to solve this problem. It is using a panel to store a button. In this case, if we resize a frame, it does afftect the size of panel, but not the button. The size of button remain the same fortunately. By follow this we can have a button with the size we wish.