[pygtk] Dialog too large
Pietro Battiston
toobaz at email.it
Thu Jan 28 15:35:24 WST 2010
Il giorno mer, 27/01/2010 alle 10.47 +0000, Peyman ha scritto:
> >
> >
> > When replying, please edit your Subject line so it is more specific
> > than "Re: Contents of pygtk digest..."
> Understood
> >
> >
> > Il giorno dom, 24/01/2010 alle 18.03 +0000, Peyman ha scritto:
> >> Sorry for the late reply, but I skipped over this e-mail. I have
> >> commented your e-mail below.
> >
> > Please, *do not* reply to digests, _in particular_ do not leave parts
> > that have nothing to do with the mail you're answering to.
> I do not understand, is this a 'digest' (pygtk a daa.com.au)? Who should
> I send the e-mails to otherwise?
> >
> > If you ask for help, it is your job to put together some code that
> > runs,
> > isn't huge and reproduces the problem. Attaching a single file
> > depending
> > on tons of imports doesn't help.
> No problem, I will will provide a self contained example. Attached is
> a simple example executes two methods. The first, effective_dialog(),
> creates a dialog which is the appropriate size. I created the most
> basic dialog for this. The second, deffective_dialog(), creates a
> dialog which is too large. This is how I implement it in my program,
> and it is causing problems.
> >
> > On the other hand, I recognize if you do the job if isolating the
> > problem, you'll maybe solve it yourself.
> I think it may have to do with the way I create the buttons in the
> create_buttons_with_image() helper function.
> >
I where not exactly able to solve the problem, but I may have understood
something more: the problem is that the action_area is a gtk.HBox, but
it seems it doesn't behave as a HBox in the fact that it doesn't take
care of the "homogeneous" property. Since the text field you add is 160
pixels wide, every other widget in the action_area takes up the same
space, and hence the window is huge.
Take a look at the attachment: I just stopped using the action_area and
added a new HBox, and it works. If instead you uncomment the
"set_homogeneous(True)" call, the problem is here again.
Now: I realize this is not a solution, and if I made no mistakes you may
also want to file a bug about that HBox not behaving like a HBox;
however, about your problem, my advice is that you're using the action
area - and, in general, the Dialog object - in a way that it is not
intended to be used: usually a dialog is really a lot of stuff, and some
_buttons_ in the bottom of the window (the action_area), so if I was in
you I would:
- just use a gtk.Window, or
- just move those controls, which are atypical for an action_area, in
other parts of the dialog.
bye
Pietro
-------------- parte successiva --------------
Un allegato non testuale � stato rimosso....
Nome: test_dialog2_mod.py
Tipo: text/x-python
Dimensione: 5076 bytes
Descrizione:
Url: http://www.daa.com.au/pipermail/pygtk/attachments/20100128/1c572387/attachment.py
More information about the pygtk
mailing list