on the second button.
entry=feeder.next(); is not what I want because all it does is draw all of the blog entry titles and then ends without displaying anything.
The other issue I have is how to grab these blog entries URLs and make them available when you click these blog titles, I haven't even attempted to do this yet because I haven't found any examples of someone doing this.
Button button1, button2, button3, button4, button5, button6, button7, button8, button9, button10;
int mode = 1;
import net.obxlabs.romefeeder.*;
import com.sun.syndication.feed.synd.*;
Feeder feeder;
int feedRate= 2*1000;
int feedLast=0;
SyndEntry entry;
void setup() {
size(400, 400);
PFont font;
font = loadFont("ACaslonPro-Bold-18.vlw");
textFont(font);
smooth();
feeder=new Feeder();
feeder.verbose=true;
feeder.sort(Feeder.PUBLISHED_DATE);
feeder.load("http://nabrgallery.wordpress.com/feed/");
feeder.setUpdateInterval(5*60*1000);
feeder.startUpdate();
color gray = color(204);
color white = color(255);
color black = color(0);
button1 = new Button(10, 80, 10, gray, white, black);
button2 = new Button(25, 80, 10, gray, white, black);
button3 = new Button(40, 80, 10, gray, white, black);
button4 = new Button(55, 80, 10, gray, white, black);
button5 = new Button(70, 80, 10, gray, white, black);
button6 = new Button(85, 80, 10, gray, white, black);
button7 = new Button(100, 80, 10, gray, white, black);
button8 = new Button(115, 80, 10, gray, white, black);
button9 = new Button(130, 80, 10, gray, white, black);
button10 = new Button(145, 80, 10, gray, white, black);
}
void draw() {
background(204);
manageButtons();
fill(0);
stroke(0);
strokeWeight(10);
strokeJoin(ROUND);
if (mode == 1) {
} else if (mode == 2) {
rect(10, 100, 370, 240);
noStroke();
triangle(30,85,25,100,35,100);
fill(255);
entry=feeder.next();
if(entry !=null)
text(entry.getTitle(),15,110,360,230);
} else if (mode == 3) {
rect(10, 100, 370, 240);
}else if (mode == 4) {
rect(10, 100, 370, 240);
} else if (mode == 5) {
rect(10, 100, 370, 240);
}else if (mode == 6) {
rect(10, 100, 370, 240);
} else if (mode == 7) {
rect(10, 100, 370, 240);
}else if (mode == 8) {
rect(10, 100, 370, 240);
}else if (mode == 9) {
rect(10, 100, 370, 240);
}else if (mode == 10) {
rect(10, 100, 370, 240);
}else if (mode == 11) {
rect(10, 100, 370, 240);
}
stroke(255);
strokeWeight(0);
}
void manageButtons() {
button1.update();
button2.update();
button3.update();
button4.update();
button5.update();
button6.update();
button7.update();
button8.update();
button9.update();
button10.update();
button1.display();
button2.display();
button3.display();
button4.display();
button5.display();
button6.display();
button7.display();
button8.display();
button9.display();
button10.display();
}
void mousePressed() {
if (button1.press() == true) {
mode = 11;
}
if (button2.press() == true) {
mode = 2;
}
if (button3.press() == true) {
mode = 3;
}
if (button4.press() == true) {
mode = 4;
}
if (button5.press() == true) {
mode = 5;
}
if (button6.press() == true) {
mode = 6;
}
if (button7.press() == true) {
mode = 7;
}
if (button8.press() == true) {
mode = 8;
}
if (button9.press() == true) {
mode = 9;
}
if (button10.press() == true) {
mode = 10;
}
}
void mouseReleased() {
button1.release();
button2.release();
button3.release();
button4.release();
button5.release();
button6.release();
button7.release();
button8.release();
button9.release();
button10.release();
}