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

This is useful to know and understand, thanks John and Milkshaw.

I want to build a scalable game board (for Go and perhaps Chess.) The behavior I want is this:

Essentially I want to be able to grab the main window and have the board AND the graphics drawn on the board scale accordingly. There will be other panes but the board itself must scale and keep it's aspect ratio. The other panes will have different scaling behavor and needs but once I understand how to implement this, it will not be a problem. I don't mind if I have to catch some event and redraw.


So I'll be playing around with this for a while to see if I can produce a simple demo. If anyone has ideas of course I'm eager to hear them!


JohnMurga Wrote:
OK, I wanted the main button to resize and the others not to ...

The secret is to read the FLTK docs carefully, and define groups to safeguard the size of certain widgets (with an invisible widget here and there).

It's pretty cool, I think I can get it to do whatever I want now.

As for Fl_Scroll, I'll try and come up with a demo ...

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

button1=fltk:Fl_Button(5, 5, 310, 135, "My First Button")

group = fltk:Fl_Group(320, 5, 180, 135, "")

nothing=fltk:Fl_Box(320, 5, 180, 35, "")
button2=fltk:Fl_Button(320, 65, 180, 35, "Load a picture")
button3=fltk:Fl_Button(320, 105, 180, 35, "Quittin Time")

group:add(nothing)
group:add(button2)
group:add(button3)

group:resizable(nothing)
window:resizable(button1)

window:show()
Fl:run()

07-25-2007 02:22 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: