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 
Changing background image of main window?
Author Message
mikecrowe
Junior Member
**


Posts: 2
Group: Registered
Joined: Jul 2007
Status: Offline
Reputation: 0
Post: #1
Changing background image of main window?

Hi folks,

Is there a way to add a background image to the main window?  Hhere's what I'm trying:

Code:
do local object = fltk:Fl_Window(100, 100, 800, 600, "Test Window")
    window = object
    local image_master_back = fltk:Fl_JPEG_Image("master_back.jpg")
    window:image(image_master_back)
...

However, it doesn't do what I expect.  

Any ideas?
TIA
Mike

07-21-2007 01:09 AM
Find all posts by this user Quote this message in a reply
mikshaw
Senior Member
****


Posts: 522
Group: Registered
Joined: Apr 2007
Status: Offline
Reputation: 5
Post: #2
RE: Changing background image of main window?

It seems as though Fl_Window does not support the image method. You can fake it by adding my_background=fltk:Fl_Box(0,0,window_width,window_height) immediately after defining the window (so all other widgets will show over it) and applying the image to the box.

EDIT:
That "do local object=blah blah; window=object" thing is really annoying. Fluid seems to be a serious waste of bytes.

Code:
window=fltk:Fl_Window(100,100,800,600,"Test Window")
background=fltk:Fl_Box(0,0,800,600)
image_master_back=fltk:Fl_JPEG_Image("master_back.jpg")
background:image(image_master_back)

This post was last modified: 07-21-2007 04:21 PM by mikshaw.

07-21-2007 02:24 AM
Find all posts by this user Quote this message in a reply
mikecrowe
Junior Member
**


Posts: 2
Group: Registered
Joined: Jul 2007
Status: Offline
Reputation: 0
Post: #3
RE: Changing background image of main window?

Perfect, that did the trick.

07-21-2007 05:50 AM
Find all posts by this user Quote this message in a reply
Post Reply  Post Thread 

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

Forum Jump: