transfluxus / controlp5

Automatically exported from code.google.com/p/controlp5
0 stars 0 forks source link

ListBox.actAsPulldownMenu does not pull back #58

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. In setup(): create new ListBox
2. Set listBox.actAsPulldownMenu( true )
3. Run applet: listBox pulls down, but doesnt close

What is the expected output? What do you see instead?

If listBox was filled with content, after selection should pull back/close 
automatically.

What version of the product are you using? On what operating system?

ControlP5 0.7.6, Processing 1.5, JDK 7.7, Win 7

Please provide any additional information below.

Testcode:

import controlP5.*;
import processing.core.*;

public class ListBoxPulldownTest extends PApplet {

    ControlP5 cp5;

    public void setup() {
        cp5 = new ControlP5( this );
        ListBox l = cp5.addListBox( "name", 20, 20, 100, 300 )
                .actAsPulldownMenu( true )
                .addItems( new String[]{ "a","b","c" } );

    }

    public void draw() {

    }
}

Original issue reported on code.google.com by Christop...@gmail.com on 5 Sep 2012 at 8:30

GoogleCodeExporter commented 8 years ago
ListBox signals itself closed (up-pointing arrow), but isnt.

Looks like items are just not drawn/updated correctly.

Original comment by Christop...@gmail.com on 5 Sep 2012 at 8:38

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
have you tried to update your background during draw()?

Original comment by soj...@gmail.com on 8 Sep 2012 at 5:10

GoogleCodeExporter commented 8 years ago
Ok, replacing draw() above with:

public void draw() {
        this.background( 0.3f );
    }

works. Thanks!!

Original comment by Christop...@gmail.com on 9 Sep 2012 at 9:24

GoogleCodeExporter commented 8 years ago
Yes it works if you set a value for the background color but if you have other 
elements such as images or shapes, they're all gone.. any solution for this?

Original comment by danny.ar...@gmail.com on 28 Mar 2013 at 5:11