News : The level of daily SPAM has reached insane proportions, all registrations are now manual. I ask you to send me an e-mail (john (at) murga (dot) org), to confirm that you want me to create an account for you.


Post Reply  Post Thread 
How to resize main window
Author Message
Don Dailey
Junior Member
**


Posts: 5
Group: Registered
Joined: Jul 2007
Status: Offline
Reputation: 0
Post: #1
RE: How to resize main window

mikshaw Wrote:
First I would set each widget to a variable name, which will give you much better control of your program:

Code:
window = fltk:Fl_Window(505, 145, "My first little app")

button1=fltk:Fl_Button(5, 5, 310, 135, "My First Button")
button2=fltk:Fl_Button(320, 65, 180, 35, "Load a picture")
button3=fltk:Fl_Button(320, 105, 180, 35, "Quittin Time")

window:show()
Fl:run()


Next, use the :resizable() method to allow resizing:

Code:
window = fltk:Fl_Window(505, 145, "My first little app")

button1=fltk:Fl_Button(5, 5, 310, 135, "My First Button")
button2=fltk:Fl_Button(320, 65, 180, 35, "Load a picture")
button3=fltk:Fl_Button(320, 105, 180, 35, "Quittin Time")

window:resizable(button1)
window:show()
Fl:run()


Now this does some ugly stretching of the buttons, And I honestly don't know how to prevent that. It seems to depend on how the widgets are aligned to each other.


Wow, this is not very intuitive. I'm trying to get a handle on this. If you want to be able to resize a window, you must resize one of the widgets in the window? I was expecting a callback or something where you manually resized it when the parent tries to resize. Is something like that possible?

I tried resizing a different button to see what would happen and it works too, but the widgets resize differently. It seems the widget you set resizable has the priority and the others follow only if needed.

So now I will try to figure out how to get better control of the sizing behavior.

Thanks for the reply.

- Don

07-24-2007 11:46 AM
Find all posts by this user Quote this message in a reply
Post Reply  Post Thread 

Messages In This Thread
How to resize main window - Don Dailey - 07-24-2007, 09:00 AM
RE: How to resize main window - mikshaw - 07-24-2007, 09:53 AM
RE: How to resize main window - Don Dailey - 07-24-2007 11:46 AM
RE: How to resize main window - mikshaw - 07-24-2007, 01:40 PM
RE: How to resize main window - JohnMurga - 07-24-2007, 05:06 PM
RE: How to resize main window - mikshaw - 07-25-2007, 01:07 AM
RE: How to resize main window - JohnMurga - 07-25-2007, 01:24 AM
RE: How to resize main window - Don Dailey - 07-25-2007, 02:22 AM

View a Printable Version
Send this Thread to a Friend
Subscribe to this Thread | Add Thread to Favorites

Forum Jump: