GIDForums  

Go Back   GIDForums > Computer Programming Forums > FLTK Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 15-Nov-2009, 10:34
tomdon tomdon is offline
New Member
 
Join Date: Nov 2009
Posts: 1
tomdon is on a distinguished road

Fl_Box in Array/Vector C++


Hi, I'm new to FLTK but have some experience with c++

Basically I'm developing a piece of software with which I wish to represent lots of particles moving around the window. i'm able to achieve this if i define each Fl_Box separately but what I wish to do is place them in a vector so I can vary the amount of particles (and become its neater).

I thought I'd be able to do something like this:

CPP / C++ / C Code:
vector<Fl_Box> boxes;

//.......

for(...){
Fl_Box tempBox(x, y, width, height);
boxes.push_back(tempBox);
}

but this doesn't seem to work, i'm sure this is a common requirement so if someone could help me out how to approach this I would greatly appreciate it.

Regards
Tom
Last edited by admin : 06-Dec-2009 at 17:10. Reason: Please insert your example C/C++ codes between [CPP] and [/CPP] tags
  #2  
Old 05-Dec-2009, 09:45
bluekid bluekid is offline
Junior Member
 
Join Date: Apr 2006
Posts: 43
bluekid will become famous soon enough

Re: Fl_Box in Array/Vector C++


CPP / C++ / C Code:
vector<Fl_Box*> boxes;

//.......

for(...){
Fl_Box *tempBox= new Fl_Box(x, y, width, height);
boxes.push_back(tempBox);
}
 
 

Recent GIDBlogInstall Adobe Flash - Without Administrator Rights by LocalTech

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 23:33.


vBulletin, Copyright © 2000 - 2010, Jelsoft Enterprises Ltd.