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. > > > > Message: 1 > > Date: Thu, 21 Jan 2010 23:13:53 +0100 > > From: Pietro Battiston <[email protected]> > > Subject: Re: [pygtk] Dialog > > To: PYGTK <[email protected]> > > Message-ID: <1264112033.4712.276.ca...@vousci> > > Content-Type: text/plain; charset="UTF-8" > > > > Il giorno gio, 21/01/2010 alle 09.36 +0000, Peyman ha scritto: > >> Hello > >> > >> I recently switched a few of my windows from being of type gtk.Window > >> to gtk.Dialog. > > > > If you can show us the code, it will be much simpler... > No problem I have attached it for you, but I essentially create the > Dialog with the following call > window > = > gtk > ..Dialog > (title=title,parent=widgets['main_window'],flags=gtk.DIALOG_MODAL| > gtk.DIALOG_DESTROY_WITH_PARENT) Yes, but this call doesn't create a huge window at all... > > > >> I fixed everything so the dialogs show up, but now > >> they are HUGE. > > > > In one dimension or both? > Generally in the horizontal dimension (because the buttons are > expanded), but in one case (embedded shell console) it is in both > directions > > > >> This has to do with the size_request of the horizontal > >> boxes (action_area). > > > > How do you know? How are things distributed? > I discovered this by doing a size request call on both the dialog and > the action_area (where the buttons are), and they both had the same > width whereas the vertical box was much smaller > > > >> Both the vbox and the action_area have > >> homogeneous=False and spacing=0 > > > > What about running > > > > while widget: > > print widget, widget.size_request(), widget.get_size_request() > > parent = widget.get_parent() > > if parent: > > try: > > print parent.child_get_property('expand') > > print parent.child_get_property('fill') > > except: > > pass > > > > > > ? > When I run the above code I get the following output > <gtk.Dialog object (GtkDialog) at 0xb7b6e7d4> (1400,129) (-1,-1) Sorry, I didn't mean to run it on the dialog itself, but on some widget nested inside the ones that are reclaiming too much space. _That_ is the information you should be interested in. > > There is no parent, even though I created the dialog with a parent > passed as a parameter Your "parent" parameter establishes a relation between toplevel windows, while the "get_parent()" method of widgets just (usually) returns the gtk.Container containing it: they are too different things, see the documentations for details. I took a look at your code, and after briefly stripping everything that impeded its usage without the external dependencies, it didn't reproduce the behaviour you described. 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. On the other hand, I recognize if you do the job if isolating the problem, you'll maybe solve it yourself. Pietro _______________________________________________ pygtk mailing list [email protected] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
