Re: Jump from PyGTK to C GTK
- From: Thomas Rønshof <tr kyborg dk>
- To: gtk-app-devel-list gnome org
- Subject: Re: Jump from PyGTK to C GTK
- Date: Tue, 7 Nov 2017 14:24:24 +0100
Hi Nils,
Try something like this...
********************
builder = gtk_builder_new ();
gtk_builder_add_from_file (builder, "test2.glade", NULL);
window = GTK_WIDGET (gtk_builder_get_object (builder, "window1"));
gtk_builder_connect_signals (builder, NULL);
but=GTK_WIDGET (gtk_builder_get_object(builder,"print_button"));
combo1=GTK_WIDGET (gtk_builder_get_object(builder,"combobox1"));
entry1=GTK_WIDGET (gtk_builder_get_object(builder,"entry1"));
gtk_widget_set_name(but,"but");
gtk_widget_set_name(entry1,"entry");
gtk_widget_set_name(window,"win");
g_signal_connect (but, "clicked",
G_CALLBACK (do_print),
NULL);
g_signal_connect (but, "button_press_event",
G_CALLBACK (do_double),
NULL);
g_signal_connect (entry1, "focus-in-event",
G_CALLBACK (do_test),
NULL);
g_signal_connect (combo1, "focus-in-event",
G_CALLBACK (do_test2),
NULL);
g_signal_connect (window, "destroy",
G_CALLBACK (on_window_destroy),
NULL);
/Thomas
Den 11/07/2017 kl. 01:52 PM skrev Nils Söderman:
Hello, i have been using glade to build a GUI, doing an app to fill
the entry-boxes with data. OK so far. But when i wanted to color the
boxes with help of PyGTK according to their content and did not
succeed with that i decided to start using c instead, where i have 20
years more experience. But i fell on a simple detail, when in PyGTK i
wanted a pointer to an entrybox, using MyBox = builder.get_object (
"MyBoxID" ) and tried to find an equivalent in GTK c i was in no luck.
So, how to exchange MyBox = builder.get_object ( "MyBoxID" ) to
c-acceptable code? ALL the example code i have found uses pointer
derived with a variant of 'new', not applicable using glade! PLEASE
point me right!
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]