1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
|
#include <ctk/ctk.h>
#include <stdio.h>
int main(int argc, char** argv)
{
CtkWidget* window;
CtkWidget* vbox;
CtkWidget* hbox;
CtkWidget* vbox2;
CtkWidget* label1;
CtkWidget* label2;
CtkWidget* button;
CtkWidget* label;
ctk_init(CTK_USEMOUSE);
/* Window */
window = ctk_window_new(CTK_WINDOW_TOPLEVEL);
ctk_widget_set_usize(window,40,3);
ctk_window_set_title(CTK_WINDOW(window),"Crazy widget layot");
ctk_widget_show(window);
vbox = ctk_vbox_new(FALSE, 1);
ctk_container_add(CTK_CONTAINER(window), vbox);
ctk_widget_show(vbox);
label = ctk_label_new("I am a fairly long string that should be word wrapped because I am such a happy camper.\nThat was a hard line feed you just saw.\nSo was that!!! Goodness gracious this is fun. Maybe I should try adding japenese support? (update: it is added!). I will do that after I finish fixing option menus (also done now). Stupid damn buggy option menus. I hate gprof! It gives lame results since I don't have libc and glibc compiled with pg! grrrr.");
ctk_label_set_line_wrap(CTK_LABEL(label), TRUE);
ctk_box_pack_start(CTK_BOX(vbox), label, TRUE, TRUE, 0);
ctk_widget_show(label);
hbox = ctk_hbox_new(FALSE, 0);
ctk_box_pack_start(CTK_BOX(vbox), hbox, FALSE, FALSE, 0);
ctk_widget_show(hbox);
vbox2 = ctk_vbox_new(FALSE, 0);
ctk_box_pack_start(CTK_BOX(hbox), vbox2, FALSE, FALSE, 10);
ctk_widget_show(vbox2);
label1 = ctk_label_new("centered");
ctk_box_pack_start(CTK_BOX(vbox2), label1, FALSE, FALSE, 0);
ctk_widget_show(label1);
label2 = ctk_label_new("a b c"); // d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9");
ctk_box_pack_start(CTK_BOX(vbox2), label2, FALSE, FALSE, 0);
ctk_label_set_line_wrap(CTK_LABEL(label2), TRUE);
ctk_widget_show(label2);
label2 = ctk_label_new("-me too-");
ctk_box_pack_start(CTK_BOX(vbox2), label2, FALSE, FALSE, 0);
ctk_widget_show(label2);
button = ctk_button_new_with_label("Bingo.");
ctk_box_pack_start(CTK_BOX(vbox), button, TRUE, FALSE, 0);
ctk_widget_show(button);
ctk_main();
return 0;
}
|