Scrolled TreeView and size allocation warnings

2017-09-30 Thread Dino Aljević
Hello,

I recently posted a question on stackoverflow.com regarding GTK Warnings I
recieve when running my application.

You can read full question here on this link
,
but in short, I am developing an application in GTK3 using PyGObject, and
the issue I'm having is with TreeView and ScrolledWindow widgets.

I have TreeView widget inside ScrolledWindow which is inside a main grid,
and whenever there are enough items in the TreeView for the scroll bar to
appear, I get spammed with the following warnings:

Gtk-WARNING **: Allocating size to __main__+MCVEWindow 04e93b30
without calling gtk_widget_get_preferred_width/height(). How does the code
know the size to allocate?

MCVEWindow is an ApplicationWindow widget which contains aforementioned
main grid.

The warnings also appear whenever I expand all TreeView items leading me to
believe it may be a layout/resizing issue.

>From what we gathered so far, the issue is not reproducible in GTK version
3.18, but it is reproducible in versions 3.22.18 and 3.22.21. I also don't
think it's a bug in my code, but rather in GTK itself although I'm new to
GTK so I'm not quite sure.

Python code is in the linked StackOverflow question, you should be able to
copy and run it, and a user on StackOverflow was kind enough to
translate my code into C version
, which
he tested on version 3.22.21.

I was wondering if someone can point out the issue or confirm it's in fact
a GTK bug, and if it is, where to report it.

Thank you in advance,
Dino


Virus-free.
www.avast.com

<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Size allocation warnings

2016-09-22 Thread Marius Gedminas
Hi!

I'm writing a Python app (gtimelog) that uses a Gtk.Paned to implement an
optional side pane.  I've an action ("win.show-task-pane") bound to a key
(F9) that is implemented as a Gio.PropertyAction linked to the "visible"
property of the Gtk.Box on the right.  I also have a Gio.Settings
binding of a setting (org.gtimelog show-task-pane) to the same "visible"
property of the same Gtk.Box (using Gio.SettingsBindFlags.DEFAULT) to
make this choice persistent.  In addition, I keep the position of the
Gtk.Paned in gsettings (org.gtimelog task-pane-position) as well and set
it on startup by calling Gtk.Paned.set_position().

The problem is that with Gtk+ 3.20.8, if my application starts with the
task pane hidden and I then press F9 to show it, I get these two
warnings:

(gtimelog:3639): Gtk-WARNING **: Allocating size to  0x1ca4320 without 
calling gtk_widget_get_preferred_width/height(). How does the code know the 
size to allocate?

(gtimelog:3639): Gtk-WARNING **: Allocating size to GtkBox 0x1a4ba50 
without calling gtk_widget_get_preferred_width/height(). How does the code know 
the size to allocate?

The first widget (0x1ca4320) is the main window (there's no class name
because it's a class defined in Python).  The second widget (0x1a4ba50)
is the Gtk.Box I'm hiding and showing (called "task_pane" in the .ui file).

There are no warnings after that, even if I hide and show the pane
again.  There no warnings whatsoever if the Gtk.Box is shown initially
on startup (because gsettings say it should be visible).


What am I doing wrong?  How can I make the warning go away?


If you'd like to play with the code, you can do that with

  git clone https://github.com/gtimelog/gtimelog
  cd gtimelog
  make  # to compile the gsettings schema
  ./gtimelog

Regards,
Marius Gedminas
-- 
But it makes the Linux kernel a bit like a bookstore that started with Greek,
Korean, and Japanese, and was happily organizing their books by character set,
and then added a section for the Latin character set, only to find that people
who can read the Latin character set can still only read a small fraction of
the books that use it, on account of a surprising lack of standardization in
the pronunciation, vocabulary, and grammar.
-- iabervon explains ARM on lwn.net
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list