Re: How can I chance this c-code(gtk+) to c++-code(gtkmm)?



Kathrin Hauptvogel wrote:

Hello

How can I chance this c-code(gtk+) to c++-code(gtkmm)?

The most important thing is to convert the function of colouring the widget.

int main(int argc, char *argv[])
{
    GtkWidget *event_box;
    GtkWidget *window;
    GdkColor red;

    gtk_init(&argc, &argv);

    window = gtk_window_new(GTK_WINDOW_TOPLEVEL);

    g_signal_connect(G_OBJECT(window), "delete_event",
            G_CALLBACK(delete_event), NULL);
    g_signal_connect(G_OBJECT(window), "destroy",
            G_CALLBACK(destroy), NULL);

    gtk_container_set_border_width(GTK_CONTAINER(window), 10);

    event_box = gtk_event_box_new();
    red.red = 65535;
    red.green = 0;
    red.blue = 0;
    gtk_widget_modify_bg(event_box, GTK_STATE_NORMAL, &red);


    gtk_container_add(GTK_CONTAINER(window), event_box);

    gtk_widget_show(event_box);
    gtk_widget_show(window);

    gtk_main();
}


Kathrin Hauptvogel

_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
http://mail.gnome.org/mailman/listinfo/gtkmm-list



Take a look at this:  http://www.gtkmm.org/docs/gtkmm-2.4/docs/

Then rewrite your code accordingly.

Bob



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]