Re: How to eliminate get_preferred_height/width warning





On Fri, Jun 2, 2017 at 9:22 PM, David Breeding <debmint49 gmail com> wrote:


On Fri, Jun 2, 2017 at 3:39 AM, "Torsten Schönfeld" <kaffeetisch gmx de> wrote:
"David Breeding" <debmint49 gmail com>:
> When I expand the TreeStore, if its size exceeds the toplevel window, I get the warning: "Allocating size to GtkWindow 0x[address] without calling gtk_widget_get_preferred width/height()

How do you expand the tree store?  By calling size_allocate() on it?  If so, then you need to call get_preferred_size() or similar beforehand.
 
I have no functions to do any size allocations.  I just create the TreeStore and allow (or so I thought) Gtk to handle everything.  As I said in prev post, This began as a Gtk2-Perl program edited to be Gtk3, but this same code (except for Gtk3 names, etc, and a few modifications for published Gtk3 diffs) I did not see this error.

If that's not it, I think a complete minimal example reproducing the problem would help.

Ok, trying to keep it as minimal as possible, I don't know if the list accepts attachments or not.  I'll try and if not, I'll resend it inline.

Further update:
I rewrote the sample program I sent in C.  The same problem occurs with it, so It's not a Perl thing but in Gtk3 itself.  

Some things I noted:

The window for which the warning is issued is, indeed, the top-level window.

it seems that horizontal oversizing does not cause this.  When the iter is expanded, this warning does not appear (as long as window is high enough to contain the expanded data.)

If the window is high enough to display all of "List 2", then if it is expanded first, then expanding "List 1" does not seem to cause the warning to be displayed (from my limited testing). 

So..  is this a bug in Gtk3?  I'm not even trying to resize the top-level window.. All I'm doing is expanding the treestore to be able to scroll through the data.  The list of the real data I'm working with is too long to fit onto the screen anyway.

If this is, indeed a bug, would anyone want to file a bug report?





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