void palette_fun_dlg_new(palette_fun_dialog** ptr, function_palette* fp) { GtkWidget* vbox; GtkWidget* frame; GtkWidget* box; palette_fun_dialog* dl; dl = g_malloc(sizeof(palette_fun_dialog)); dl->fun_pal = fp; *ptr = dl; dl->box = vbox = gtk_vbox_new(FALSE, 0); frame = gtk_frame_new("Functions"); gtk_container_set_border_width(GTK_CONTAINER(frame),4); gtk_container_add(GTK_CONTAINER(vbox), frame); box = gtk_vbox_new(FALSE, 0); dl->ex_rg_button = gui_button_new("R <-> G", pal_fun_buttonfunc, box, dl); dl->ex_gb_button = gui_button_new("G <-> B", pal_fun_buttonfunc, box, dl); dl->ex_br_button = gui_button_new("B <-> R", pal_fun_buttonfunc, box, dl); dl->rot_rgb_button = gui_button_new("Rotate RGB", pal_fun_buttonfunc, box, dl); dl->inv_rgb_button = gui_button_new("Invert RGB", pal_fun_buttonfunc, box, dl); dl->inv_r_button = gui_button_new("Invert Red", pal_fun_buttonfunc, box, dl); dl->inv_g_button = gui_button_new("Invert Green", pal_fun_buttonfunc, box, dl); dl->inv_b_button = gui_button_new("Invert Blue", pal_fun_buttonfunc, box, dl); gtk_container_add(GTK_CONTAINER(frame), box); dl->pa = pal_affect_new(dl->box, &dl->fun_pal->offset, &dl->fun_pal->stripe, &dl->fun_pal->spread); gtk_widget_show_all(dl->box); }
gwidget* gui_button_new_with_label(const char *label) { gwidget *widget = gui_button_new(); widget->string = label; }