Re: [evolution-patches] move e-charset-picker to GtkDialog

On Sun, 2003-05-18 at 01:58, Larry Ewing wrote:
> > +       g_object_ref (dialog);
> > +       if (gtk_dialog_run (dialog) == GTK_RESPONSE_OK) {
> > 
> > there's no reason to g_object_ref() there as far as I can tell. Also,
> > you'll end up leaking the dialog if the response is OK and the inner
> > if-statements also pass.
> > 
> > same g_object_ref/unref combo doesn't need to be there in the next
> > function either.
> > 
> As I mentioned on irc I did this because it is marked
> GTK_DIALOG_DESTROY_WITH_PARENT and I'm not certain gtk will block all
> possible ways of destroying the parent even with it being modal.  I
> figured the ref was harmless and might avoid problem.  Of course the ref
> is only harmless if you unref it everywhere ;)

I *think* that no matter how the dialog gets destroyed, it will still be
"alive" when you return from gtk_dialog_run(), but I'm not 100%

> I left in the reffing (with the fix) but I'll happily take it out if
> someone objects.

that's fine by me, better safe than sorry at this point I guess :-)

>   Also I made up the padding, can someone who knows what
> we they are doing tell me what should be done HIG wise?

the container width is right, as far as the vbox padding - that has
always confused me.

the way I've found to get it to be right, is to do:

gtk_box_set_spacing (GTK_BOX (vbox), 6);
gtk_box_pack_start (GTK_BOX (vbox), widget, ..., ..., 0);

however, in the case of dialog->vbox, I think doing that makes things
look wonky because the dialog button hbox has already set it's padding
and so you get the vbox spacing plus the button-box padding ,and the
buttons look like they are floating out in the middle of a lake :-)

so I think using the box_pack padding is the right way to do it here,
but I'm not sure if that padding would be 3 or 6 (spacing between
widgets should be 6, but I think if you pad each widget in a vbox with 6
pixels, it results in a spacing between widgets of 12 pix?)

if I'm wrong, just ignore me - this has been something that has always
confused me :-)

> Thanks for catching all these problems Jeff, and happy belated birthday.



Jeffrey Stedfast
Evolution Hacker - Ximian, Inc.
fejj ximian com  -

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