dtk progress

  • Thread starter Deleted User
  • Start date
  • Views 670
  • Replies 0
D

Deleted User

Guest
OP
Mirror from http://deufeufeu.free.fr/devblog/?p=5 :

Maybe some of you are aware that I'm currently in the process of coding a gtk-like widget library. This is a long process because I want it to be easily used by anyone.Right now there's a basic widget system, with buttons, labels, box for packing widget, ect... It's still missing some really important features : redraw only when needed (invalidating rectangles) and separating the size request from the size allocation. Here is a screenshot :

dtk01.png


And here the code used to generate it :

CODE#include
using namespace dtk;
Label *l;

void setLabel1(Button *btn) {
 Âl->setText("Left button\nwas activated\n");
}

void setLabel2(Button *btn) { Â Â
 Âl->setText("Right button\nwas activated\n");
}

int main(void) {
ÂApplication app;
ÂFrame frame_bottom;
ÂFrame frame_top;
ÂButton b1("Left", true);
ÂButton b2("Right");
ÂBox b(true);

Âl = new Label("To activate left button click one time\nTo activate right button click to select\nand reclick to hit"); Â

Âapp.init();
Âb1.sigActivate.connect(setLabel1);
Âb2.sigActivate.connect(setLabel2);
Âframe_bottom.add(&b);
Âb.packStart(b1);
Âb.packStart(b2);
Âframe_top.add(l);
Âapp.setFrame(&frame_top, SCREEN_TOP);
Âapp.setFrame(&frame_bottom, SCREEN_BOTTOM);
Âapp.mainloop();
Â
Âreturn 0;
}
 

You may also like...

General chit-chat
Help Users
    K3N1 @ K3N1: Welp doctors think I might be diabetic now