[Glade-users] Progressbar is not using available space (GtkCellRendererProgress)
Tristan Van Berkom
tvb at gnome.org
Mon Feb 28 13:57:20 EST 2011
On Tue, Mar 1, 2011 at 2:05 AM, Manuel <manuel at wenns-um-email-geht.de> wrote:
> Hi,
>
> i used Glade to create a simple GUI containing a GtkTreeView which
> contains a Column with a GtkCellRendererProgress.
> In general i followed the steps of the following tutorial to create the GUI:
> http://tadeboro.blogspot.com/2009/04/creatin-gtktreeview-with-glade-3.html
>
> I changed two little things:
> 1. I set the "expand" property for the progress-column to True.
> 2. I set the "resizable" property for the progress-column to True.
>
> In Glade i can now resize the column and it will use all the available
> space to display the progressbar.
> When i use the glade-file in my python-program the progress-column uses
> all the available space too, but the space is not filled by the
> progressbar. So resizing the column does not change the size of the
> progressbar.
>
> The user of the following forum-thread has the same problem:
> http://www.gtkforums.com/about5153.html
> (The posting contains example pictures :-)
>
> Here is my generated glade-file:
> http://pastebin.com/GmikbPAA
>
> I hope you can help me get the progressbar using the available space :)
Sorry, there is a discrepancy between how Glade packs cell renderers
and how GTK+ packs them when reading them from the builder file.
Currently Glade packs them all into the layout using
gtk_cell_layout_pack_start () with the 'expand' argument TRUE,
GtkBuilder on the other hand uses FALSE.
With GTK+ 2.x there is *no way* to define renderers that expand in the
treeview column. However GTK+ 3.0 introduces <cell-packing> properties
which can be used to define properties of how a cell is positioned in it's
GtkCellArea.
While this is now possible using GTK+ 3.0, Glade still does not support
reading or editing these options and probably will not get there before
the coming Glade 3.10 release.
You can do one of the following:
- Use gtk_cell_layout_pack_start() yourself in the code to add
renderers to treeview columns with GTK+ 2.x
- Use gtk_cell_area_box_pack_* apis to pack your renderers with
more options available in 3.0
- Use a hand-crafted GtkBuilder fragment with GTK+ 3.0 to use the
<cell-packing>
tags and add the treeview portion to your interface... then when
Glade starts to
understand <cell-packing> options... probably by Glade 3.12...
then you can merge
in that hand-crafted file into the rest of your UI safely.
Sorry for the incovenience... the expand property was never really available
with GtkBuilder until now with GTK+ 3.0.
Cheers,
-Tristan
More information about the Glade-users
mailing list