[Glade-users] [SOLVED] Re: Button packing



On Thu, 2013-05-09 at 14:21 -0700, David Buchan wrote:
ok, now I see what I was missing. You have "Horizontal Expand" set to
"Yes" in the "Common" tab.

The "Common" tab is just a place where we put properties
which are shared by all GtkWidget classes.

I might remove the common tab one day, originally it was
just there to avoid crowding the property editor too much
(there are so so many properties :-/)


I don't fully understand why that was necessary or exactly what it is
doing though. I need to read up on what it means for parameters to be
in the "Common" tab versus the "Packing" tab.

Regardless, thanks for solving this! Whew!
I really appreciate all the time you put into supporting users.

Dave





______________________________________________________________________
From: Tristan Van Berkom <tristanvb at openismus.com>
To: David Buchan <pdbuchan at yahoo.com> 
Cc: "tristan.van.berkom at gmail.com" <tristan.van.berkom at gmail.com>;
Glade List <glade-users at lists.ximian.com> 
Sent: Thursday, May 9, 2013 7:03 AM
Subject: Re: [Glade-users] [SOLVED] Re: Button packing


On Thu, 2013-05-09 at 03:48 -0700, David Buchan wrote:
I did try that, and it works for the left button, but the right
button
then moves to the left to be beside the left button. The Pack Type
property in the Packing tab only has two possible values: "Start"
and
"End." The default appears to be "Start", and this takes precedence,
overriding the Horizontal Alignment = "End" in the Common tab.

Because of that I had concluded that I must use the Pack Type
property. I'm not sure what to do then.

I'm a little perturbed, it seems that GtkBox has broken somehow,
whereas
this container is supposed to distributed expand space to all children
if no children requested to expands, it would seem that this behavior
has changed somehow over time.

Besides this being a sort of API break in GtkBox (I'm sure GTK+ 3.0
did not behave like this), you should be able to easily work around
it by setting both buttons to expand.

Attaching a sample.

Cheers,
    -Tristan






Dave






______________________________________________________________________
From: Tristan Van Berkom <tristan.van.berkom at gmail.com>
To: David Buchan <pdbuchan at yahoo.com> 
Cc: Glade List <glade-users at lists.ximian.com> 
Sent: Thursday, May 9, 2013 3:05 AM
Subject: Re: [Glade-users] [SOLVED] Re: Button packing


On Thu, May 9, 2013 at 11:44 AM, David Buchan <pdbuchan at yahoo.com>
wrote:
ok, I think I've got it.

I used a non-homogeneous GtkBox (horizontal) with two fields. I
put
a button
in each field. Then I clicked on the first (left) button and in
the
Packing
field I set Pack Type to "Start." I clicked on the second (right)
button and
in the Packing field I set Pack Type to "End." I used the defaults
for Fill
and Expand for the buttons, which were "Yes" and "No",
respectively.

Ok that's a bit weird, I don't recommend this method (it's kindof
a remaining API from GTK+-2, and also... using the pack type
will have some other implication, such as reversing your buttons
in RTL mode, which you probably dont really care about but
still, I wouldn't recommend using the "Pack Type" property here).

I would recommend to just use the "Horizontal Alignment"
property (found in the "Common" tab).

Set your first button to have "Horizontal Alignment" "Start"
and the other button to have "End".

Cheers,
       -Tristan



That's pretty neat and tidy.  Glade is great.

Dave
________________________________
From: David Buchan <pdbuchan at yahoo.com>
To: Glade List <glade-users at lists.ximian.com>
Sent: Wednesday, May 8, 2013 4:13 PM
Subject: [Glade-users] Button packing

Hi,

I would like to place two buttons in my window. I want one button
to
be at
the left side of the window, and the other at the right side of
the
window.

I tried putting a GtkBox (horizontal) with 5 columns. I chose 5 so
that I'd
get the width of buttons I want. Then I put one button in position
0, and
the other at position 4.

What I find is that when the window is rendered, it expands the
buttons so
that each one takes half the window width, filling the entire row.

I tried the same thing with a GtkGrid with 1 row, but had the same
result.
I've fooled around with every Expand/Fill combination I could
think
of, but
it didn't help.

The solution was to put blank labels in the 3 inner positions.
This
worked
whether I used a GtkBox or GtkGrid. But I can't help feeling like
I
shouldn't need to put empty labels to make this work.

Ideas?

Dave

_______________________________________________
Glade-users maillist  -  Glade-users at lists.ximian.com
http://lists.ximian.com/mailman/listinfo/glade-users



_______________________________________________
Glade-users maillist  -  Glade-users at lists.ximian.com
http://lists.ximian.com/mailman/listinfo/glade-users




_______________________________________________
Glade-users maillist  -  Glade-users at lists.ximian.com
http://lists.ximian.com/mailman/listinfo/glade-users




_______________________________________________
Glade-users maillist  -  Glade-users at lists.ximian.com
http://lists.ximian.com/mailman/listinfo/glade-users






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