Re: GtkGrid children and GTK_ALIGN_END

2017-10-18 Thread Bill Kelly
Bill Kelly wrote:
> Daniel Boles wrote:
> 
>> I found that hexpanding the Entry too got around this, but it may not be
>> exactly what you want.
> 
> I'd noticed that too, though it's indeed not what I'd wanted in this case.

In case anyone encounters this thread later looking for a solution:

I was mistaken.  Setting hexpand on the GtkEntry indeed *did* produce the
result I'd wanted.

I thought I'd tried all the permutations, but it seems I was conflating
'expand' and 'fill'.

So: Apologies for the noise.


Regards,

Bill



___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: GtkGrid children and GTK_ALIGN_END

2017-10-12 Thread Daniel Boles
The wildcard here, and what makes me confused as to whether my own
rationale makes sense, is that you have the grid expanding; I can't
immediately think of cases where I've used such a construct, so I don't
know what I expect it to do! It's also been a while since I thought about
how alignment and expansion interact - I think once you get your program to
a point where it works, the brain begins to remove that information ;) - so
I don't know if anything I've said makes much sense, and would like an
opinion from someone else.
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: GtkGrid children and GTK_ALIGN_END

2017-10-12 Thread Bill Kelly

Daniel Boles wrote:
> Assuming I understand this guide right, then it does kinda make sense to me.
>
> https://developer.gnome.org/gtk3/stable/ch30s02.html

Thanks, that's a handy link.


> I found that hexpanding the Entry too got around this, but it may not be
> exactly what you want.

I'd noticed that too, though it's indeed not what I'd wanted in this case.

But, I can imagine some potential workarounds.


Thanks for your help!

Bill

___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: GtkGrid children and GTK_ALIGN_END

2017-10-12 Thread Daniel Boles
On 12 October 2017 at 13:10, Daniel Boles  wrote:

> By my understanding, the explanation is this:
>
>- the Entry *is *right-aligned within its cell
>- but then the Grid is set to align fill and expand, so it expands
>empty space beyond the Entry and the cell it's in
>
> Assuming I understand this guide right, then it does kinda make sense to
> me.
>
> https://developer.gnome.org/gtk3/stable/ch30s02.html
>
> I found that hexpanding the Entry too got around this, but it may not be
> exactly what you want.
>

since a test case is always useful...

#include 

int
main (intargc,
  char **argv)
{
  gtk_init (, );

  GtkWidget *grid = gtk_grid_new ();
  gtk_widget_set_hexpand (grid, TRUE);
  gtk_widget_set_halign (grid, GTK_ALIGN_FILL);
  gtk_orientable_set_orientation ((GtkOrientable *)grid,
GTK_ORIENTATION_HORIZONTAL);

  GtkWidget *entry = gtk_entry_new ();
  gtk_widget_set_halign (entry, GTK_ALIGN_END);
  gtk_container_add ((GtkContainer *)grid, entry);

  GtkWidget *window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_container_add ((GtkContainer *)window, grid);
  gtk_widget_show_all (window);

  gtk_main ();
}
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-devel-list