Re: g_log_set_fatal_mask() not working for me.

2017-12-18 Thread Eric Cashon via gtk-app-devel-list

 
I found this bug for the scrollbar warning.

https://bugzilla.gnome.org/show_bug.cgi?id=769566

I don't know about the critical warning that you have or have a solution 
figured out. I am not much help there.

Eric 


___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: g_log_set_fatal_mask() not working for me.

2017-12-18 Thread Richard Shann
On Sun, 2017-12-17 at 17:54 -0500, cecas...@aol.com wrote:
> 
> Hi Richard,
> 
> This sounds similar to the problem Dino Aljević had in "Scrolled
> TreeView and size allocation warnings" in this list in September?
> 
> I can get the warning
> 
> "(treeview4:3830): Gtk-WARNING **: Allocating size to GtkWindow
> 0x843e188 without calling gtk_widget_get_preferred_width/height().
> How does the code know the size to allocate?"
> 
> with the following code with GTK3.22.26 but I don't see the warning
> in GTK3.18.9. To get the warning expand the treeview until the list
> extends past the window boundry. I looked on Bugzilla but I didn't
> see it listed there. I am not great at finding things on Bugzilla so
> that doesn't mean it isn't there.
> 
> Do you have some test code to produce the GtkScrollbar warning you
> are seeing?

No, indeed, the warnings are appearing during the start up of a very
large program and I'm trying to locate the part of the program they are
coming from ...

> 
> For the g_log_set_fatal_mask() and a runtime
> stop, try starting your code with 
> 
> G_DEBUG=fatal-warnings
> 
That's good to know, but it is rather a blunt instrument, calling
g_log_set_fatal_mask() from the debugger normally lets you pin down
particular warnings. Bizarrely, at present gdb has suddenly got amnesia
and declares
(gdb) call g_log_set_fatal_mask ("Gtk", 0x)
No symbol "g_log_set_fatal_mask" in current context.
Where previously it was returning the previous mask as it should.

> It is a warning though. Something needs to be fixed but your program
> should run fine.

Yes, it doesn't seem to cause a problem, but there is worse to come - I
have had a couple of crashes coming from Gtk since upgrading to Debian
Stable (hence Gtk 3.22) and I can get this:

Gtk-CRITICAL **: gtk_box_gadget_distribute: assertion 'size >= 0'
failed in GtkScrollbar

during a gtk_widget_show_all () of a widget that has previously been
working. At least I know where this one is happening...

Thanks for you helpful reply,

Richard
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: g_log_set_fatal_mask() not working for me.

2017-12-17 Thread Eric Cashon via gtk-app-devel-list

 
Hi Richard,

This sounds similar to the problem Dino Aljević had in "Scrolled TreeView and 
size allocation warnings" in this list in September?

I can get the warning

"(treeview4:3830): Gtk-WARNING **: Allocating size to GtkWindow 0x843e188 
without calling gtk_widget_get_preferred_width/height(). How does the code know 
the size to allocate?"

with the following code with GTK3.22.26 but I don't see the warning in 
GTK3.18.9. To get the warning expand the treeview until the list extends past 
the window boundry. I looked on Bugzilla but I didn't see it listed there. I am 
not great at finding things on Bugzilla so that doesn't mean it isn't there.

Do you have some test code to produce the GtkScrollbar warning you are seeing?

For the g_log_set_fatal_mask() and a runtime stop, try starting your code with 

G_DEBUG=fatal-warnings

It is a warning though. Something needs to be fixed but your program should run 
fine.

Eric



/*
gcc -Wall treeview4.c -o treeview4 `pkg-config --cflags --libs gtk+-3.0`
Tested on Ubuntu16.04 with GTK3.18.9 and GTK3.22.26

run with

G_DEBUG=fatal-warnings GTK_THEME=Adwaita:dark ./treeview4

this theme doesn't produce any css warnings with GTK3.22.26.

*/
#include

static GtkTreeStore* get_tree_store();

int main(int argc, char *argv[])
  {
gtk_init(, );

g_print("%i.%i.%i\n", GTK_MAJOR_VERSION, GTK_MINOR_VERSION, 
GTK_MICRO_VERSION);

g_log_set_fatal_mask("Gtk", G_LOG_LEVEL_WARNING);

GtkWidget *window=gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_title(GTK_WINDOW(window), "Tree View");
gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
gtk_window_set_default_size(GTK_WINDOW(window), 300, 300);
g_signal_connect(window, "destroy", G_CALLBACK(gtk_main_quit), NULL);

GtkTreeStore *store=get_tree_store();

GtkWidget *tree=gtk_tree_view_new_with_model(GTK_TREE_MODEL(store));
gtk_tree_view_set_enable_search(GTK_TREE_VIEW(tree), TRUE);
g_object_unref(G_OBJECT(store));

GtkCellRenderer *renderer1=gtk_cell_renderer_text_new();
g_object_set(renderer1, "editable", TRUE, NULL);
   
GtkTreeViewColumn *column1 = 
gtk_tree_view_column_new_with_attributes("Shape Coordinates", renderer1, 
"text", 0, NULL);
gtk_tree_view_append_column(GTK_TREE_VIEW(tree), column1); 

GtkWidget *scroll=gtk_scrolled_window_new(NULL, NULL);
gtk_container_set_border_width(GTK_CONTAINER(scroll), 5);
gtk_widget_set_vexpand(scroll, TRUE);
gtk_widget_set_hexpand(scroll, TRUE);
gtk_container_add(GTK_CONTAINER(scroll), tree);   

GtkWidget *grid=gtk_grid_new();
gtk_container_set_border_width(GTK_CONTAINER(grid), 20);
gtk_grid_attach(GTK_GRID(grid), scroll, 0, 0, 1, 1);
gtk_container_add(GTK_CONTAINER(window), grid);
   
gtk_widget_show_all(window);
gtk_main();
return 0;   
  }
static GtkTreeStore* get_tree_store()
  {
gint i=0;
gint j=0;
GtkTreeStore *store=gtk_tree_store_new(1, G_TYPE_STRING);

GtkTreeIter iter1;
GtkTreeIter iter2;
gtk_tree_store_append(store, , NULL);
for(i=0;i<3;i++)
  {
gchar *string1=g_strdup_printf("S%i", i);
gtk_tree_store_set(store, , 0, string1, -1);
g_free(string1);
for(j=0;j<5;j++)
  {
gtk_tree_store_append(store, , );   
gchar *string2=g_strdup_printf("C%i", j);
gtk_tree_store_set(store, , 0, string2, -1);
g_free(string2);
  }
gtk_tree_store_append(store, , NULL);
  }
  
return store;
  }

 


___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list