ListBoxs and Models


#1

Hello Please Help!!
I’ve got an app with two windows one at the top of the page and one at the bottom
window 1 is like this :

square box with 4 dragandanddrop buttons – is a draganddrop container
target -> is a rectangle, 520*40 pixels-- is a draganddrop target listener

this works fine - the 4 buttons drag from the square onto the 520*150 rectangle ok and the listeners work fine

window 2 is like this:

both listener and container are the same size, a rectangle which is 500 * 300
the container has 1 row and 1 item, a vertical red arrow (rowheight 300)

when I put the window 1 on its own, it works fine
also when I put window 2 on its own, it works fine (on its own) - get a nice red arrow which I will use as a song pointer (hopefully soon!)
but when I ask it to do both:
the square box window works fine BUT it should also show my 500300 box with my vertical red arrow 300 pixels high, instead it displays my second window as
520
40 pixels (ie. all squished) and my red arrow appears with a vertical scrollbar.

I realise in my window1, boxlistener is instantiated with setmodel(this) – and this gives a source with setRowHeight( 40 )
I dont want window 2 to have the same size setRowHeight ! is the becuase that the setModel(this) in both cases is getting confused?>
How do I say setModel for my 2nd listBoxModel is not (this), but “(that)”? lol I tried making my own setModel(newModel) class and instantiating as an object for the 2nd window but It started moaning that I was overloading the listbox. How do I take the setModel(this) out of the equation so that both windows have seperate setModel structures?
btw I’m using culled code from JuceDragAndDropDemo so, it’s identical to that, but with two DragAndDropDemos on the same app. what exactly is the “this” in setModel(this)? please help cause I know it sounds a bit thick but I’m getting lost v.quickly
Thanks chaps.


#2

LOL Ive just spent ALL DAY trying to sort this issue out and It’s been because I’ve missed 1 line, yes, 1 line of setBounds :shock: which I forgot I’d copid and pasted then forgot about!
fraking heck it works OK now no confusion
Simples! only a whole day or so wasted lol. :evil: