How to eliminate get_preferred_height/width warning

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How to eliminate get_preferred_height/width warning

David Lowrence
Using gtk3-perl, I have the following:
Gtk3::Window -> Gtk3::Box -> ScrolledWindow -> TreeStore

My code was edited from Gtk2 code.

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()

I don't know if this is a gtk3-perl bug or if I now have to insert a call somewhere.  I've tried creating signal_connects for (just guessing) size-allocate signal for the toplevel window, the scrolled window and the treestore with no positive results.

I've run the code through the perl debugger, and the address of the Window shown in the warning is none of the toplevel window, the scrolled window or the treestore.

I've searched for published code to give me an example of ways to eliminate this with no success.  All I can find is code that manually sets the size of the container window.

If anyone can give me insight into what I might need to do to eliminate this I would greatly appreciate it.


_______________________________________________
gtk-perl-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-perl-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to eliminate get_preferred_height/width warning

"Torsten Schönfeld"
"David Breeding" <[hidden email]>:
> 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.

If that's not it, I think a complete minimal example reproducing the problem would help.
_______________________________________________
gtk-perl-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-perl-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Fwd: How to eliminate get_preferred_height/width warning

David Lowrence

---------- Forwarded message ----------
From: David Breeding <[hidden email]>
Date: Fri, Jun 2, 2017 at 9:22 PM
Subject: Re: How to eliminate get_preferred_height/width warning
To: Torsten Schönfeld <[hidden email]>




On Fri, Jun 2, 2017 at 3:39 AM, "Torsten Schönfeld" <[hidden email]> wrote:
"David Breeding" <[hidden email]>:
> 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.


_______________________________________________
gtk-perl-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-perl-list

tst.pl (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to eliminate get_preferred_height/width warning

David Lowrence
In reply to this post by "Torsten Schönfeld"


On Fri, Jun 2, 2017 at 9:22 PM, David Breeding <[hidden email]> wrote:


On Fri, Jun 2, 2017 at 3:39 AM, "Torsten Schönfeld" <[hidden email]> wrote:
"David Breeding" <[hidden email]>:
> 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?




_______________________________________________
gtk-perl-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-perl-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to eliminate get_preferred_height/width warning

"Torsten Schönfeld"
On 05.06.2017 04:51, David Breeding wrote:
> 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?

It does sound like a bug in gtk+.  Ideally, you'd file the bug report
yourself, attaching the C program you wrote.  This can be done here:
<https://bugzilla.gnome.org/enter_bug.cgi?product=gtk%2B>.  You'd need
to create an account if you haven't already.
_______________________________________________
gtk-perl-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-perl-list
Loading...