datafox wrote:
> 
> Hello!
> 
> I'm new in Linux world and I'm just starting to make my own applications
> for Linux. I'm using Gtk+-1.1.11 and PyGtk-0.5.9 on RedHat 5.1.
> Before I wrote many programms for Mikysoft Windoze in Delphi and Visual
> Basic, so I'm not new in programming. And now what's my problem.
> I'm trying to extend the example of IDE for PyGtk. I wrote 2 modules,
> cvs.py and GtkMExtra.py. I hate when by showing some window places
> itself somewhere on the screen. I'd like to show the window centered in
> the screen. I found the method of GtkWindow named set_position. I tried
> to use it but it behaves strange. In module cvs.py behaves it correct
> and the window shows in the center of the screen. In module GtkMExtra.py
> behaves it other. The window _EntryDialog shows somewhere on the screen.
> I don't understand it! Why?
> 
> Can you help me? Please look into the code.

The scrolled window within the the modules dialog is somehow allowing
the cvs.py file to work like you are expecting it to.  If you comment
out the following 3 lines, you get the exact same behavior for both
windows.

>                 scrolled_win.set_policy(POLICY_AUTOMATIC, POLICY_AUTOMATIC)
>                 box.pack_start(scrolled_win)
>                 scrolled_win.show()

>         win.show()
>         win.set_position(1)

As I believe was already mentioned, you need to do set_position() before
show().  In my testing, this works perfectly for both cases, with or
without the scrolled window.

If it still doesn't work for you, it is likely that your window manager
is ignoring the positioning requests of the dialogs (which is perfectly
valid behavior for X).


-- 
Richard Fish                      Enhanced Software Technologies, Inc.
Software Developer                4014 E Broadway Rd Suite 405
[EMAIL PROTECTED]                    Phoenix, AZ  85040 
(602) 470-1115                    http://www.estinc.com
To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]

Reply via email to