Re: does being inside a grid make an entry more editable?



ok, i suppose that i said i would report, so i guess i have to own up
to it ----- i really goofed, and had a shadow variable that i was
changing the editability of (so the item in the grid never got it's
editability modified).

(so: nothing to do with gtk3, or grid, or entry, or anything except me
not checking my code carefully enough)

dan

On Fri, Mar 10, 2017 at 8:33 PM, Dan Hitt <dan hitt gmail com> wrote:
Thanks a million Tilo!

Your example (which works compiles and runs just fine on my system)
proves that my problem lies elsewhere.

As to my gtk version, it is probably 3.22.8 (i'm using debian, and
installed the gtk3 examples package, and i believe as a result of that
i have an app called gtk3-demo-application, and it reports its version
as 3.22.8).

No doubt it is plenty recent enough, so i just need to dig in deeper
(will report if and when i get to the bottom of this).

dan



On Fri, Mar 10, 2017 at 12:05 AM, Tilo Villwock <codemusings gmail com> wrote:
Hello Dan,

I don't think this issue is related to entries being placed inside a
grid. I created this minimal example and it's working fine for me:

    #include <gtk/gtk.h>

    static void activate(GApplication* app, gpointer user_data)
    {
        GtkWidget* window = gtk_application_window_new(
            GTK_APPLICATION(app));
        gtk_window_set_title(GTK_WINDOW(window), "GridTest");
        gtk_container_set_border_width(GTK_CONTAINER(window), 10);

        GtkWidget* entry1 = gtk_entry_new();
        GtkWidget* entry2 = gtk_entry_new();
        GtkWidget* entry3 = gtk_entry_new();
        GtkWidget* entry4 = gtk_entry_new();

        gtk_editable_set_editable(GTK_EDITABLE(entry1), FALSE);
        gtk_editable_set_editable(GTK_EDITABLE(entry3), FALSE);

        GtkWidget* grid = gtk_grid_new();
        gtk_grid_set_row_spacing(GTK_GRID(grid), 10);
        gtk_grid_set_column_spacing(GTK_GRID(grid), 10);
        gtk_grid_attach(GTK_GRID(grid), entry1, 0, 0, 1, 1);
        gtk_grid_attach(GTK_GRID(grid), entry2, 0, 1, 1, 1);
        gtk_grid_attach(GTK_GRID(grid), entry3, 1, 0, 1, 1);
        gtk_grid_attach(GTK_GRID(grid), entry4, 1, 1, 1, 1);

        gtk_container_add(GTK_CONTAINER(window), grid);
        gtk_widget_show_all(window);
    }

    int main(int argc, char** argv)
    {
        GtkApplication* app = gtk_application_new(
            "de.codemusings.GridTest", G_APPLICATION_FLAGS_NONE);
        g_signal_connect(app, "activate", G_CALLBACK(activate), NULL);
        int retval = g_application_run(G_APPLICATION(app), argc, argv);
        g_object_unref(app);

        return retval;
    }

Compiled with:

    gcc -Wall -Werror -pedantic -std=c99 \
        `pkg-config --cflags --libs gtk+-3.0` grid-test.c -o grid-test

The entries in the first row are not editable this way. What GTK
version are you using?

--Tilo

Am Donnerstag, den 09.03.2017, 19:43 -0800 schrieb Dan Hitt:
I have some entries that are inside a grid (all gtk3 stuff).

I cannot seem to make them uneditable with a call to
gtk_editable_set_editable().

I also have an entry outside the grid, which
gtk_editable_set_editable() certainly can make uneditable.

So i think the difference between the two cases is the grid, and i'm
wondering if putting an entry inside a grid somehow makes it more
editable.  (Maybe this is obvious from some piece of documentation,
and i'm just being really opaque.)

Anyhow, thanks in advance for any info, one way or another, on how
being inside a grid would affect the editability of an entry!

dan
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


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