Hi, Normally/By Default the position of Directory and File Dialog
boxes is at the center of screen. Is it possible to position them
where I want specifying pixels or at least at the center of my
application?
thanks in advance.
Sandeep Patil
Hi, Normally/By Default the position of Directory and File Dialog
boxes is at the center of screen. Is it possible to position them
where I want specifying pixels or at least at the center of my
application?
thanks in advance.
Sandeep Patil
Hi,
Hi, Normally/By Default the position of Directory and File Dialog
boxes is at the center of screen. Is it possible to position them
where I want specifying pixels or at least at the center of my
application?
You can do it just the same as any other dialog.
*) Read the documentation.
*) All window objects have 'pos' argument that allows you to specify
the position
*) There is a CenterOnParent() method to center it on the parent window
*) There is a SetPosition method to manually set an arbitrary position
in coordinate points.
Cody
On Mon, Nov 29, 2010 at 9:52 AM, Sandeep <sandeeppatil2u@gmail.com> wrote:
I have tried all the ways:
-> 'pos' argument do not work
-> 'CenterOnParent' do not work
-> 'SetPosition' do not work
These work only for wx.Dialog box, but not for wx.DirDialog,
wx.FileDialog and wx.MessageDialog boxes.
On Nov 29, 9:48 pm, Cody Precord <codyprec...@gmail.com> wrote:
Hi,
On Mon, Nov 29, 2010 at 9:52 AM, Sandeep <sandeeppati...@gmail.com> wrote:
> Hi, Normally/By Default the position of Directory and File Dialog
> boxes is at the center of screen. Is it possible to position them
> where I want specifying pixels or at least at the center of my
> application?You can do it just the same as any other dialog.
*) Read the documentation.
*) All window objects have 'pos' argument that allows you to specify
the position
*) There is a CenterOnParent() method to center it on the parent window
*) There is a SetPosition method to manually set an arbitrary position
in coordinate points.Cody
See bottom ...
From: wxpython-users@googlegroups.com [mailto:wxpython-
users@googlegroups.com] On Behalf Of Sandeep
Sent: Monday, November 29, 2010 10:08 PM
To: wxPython-users
Subject: [wxPython-users] Re: positioning FileDialog or DirDialog boxI have tried all the ways:
-> 'pos' argument do not work
-> 'CenterOnParent' do not work
-> 'SetPosition' do not workThese work only for wx.Dialog box, but not for wx.DirDialog,
wx.FileDialog and wx.MessageDialog boxes.> Hi,
>
> > Hi, Normally/By Default the position of Directory and File Dialog
> > boxes is at the center of screen. Is it possible to position them
> > where I want specifying pixels or at least at the center of my
> > application?
>
> You can do it just the same as any other dialog.
>
> *) Read the documentation.
> *) All window objects have 'pos' argument that allows you to specify
> the position
> *) There is a CenterOnParent() method to center it on the parent window
> *) There is a SetPosition method to manually set an arbitrary position
> in coordinate points.
>
> Cody--
To unsubscribe, send email to wxPython-
users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en
[alm>]
This works for me. This method is in a class in a class ... in a wx.Dialog.
Note that Calc_Dialog_Position returns a (x,y) to center the dialog on my
app frame.
def OnBrowseImport( self, evt ):
wildcard = "Areg import (*.out) " \
"All files (*.*)|*.*"
dlg = wx.FileDialog( None, "Choose a file to import", os.getcwd(),
"", wildcard, wx.OPEN )
dlg.SetPosition( autil.Calc_Dialog_Position( dlg ) )
if dlg.ShowModal() == wx.ID_OK:
val = dlg.GetPath()
self.txt_import.SetValue( val )
#log.debug( '3.1 val={0}'.format( val ) )
dlg.Destroy()
Al
-----Original Message-----
On Nov 29, 9:48 pm, Cody Precord <codyprec...@gmail.com> wrote:
> On Mon, Nov 29, 2010 at 9:52 AM, Sandeep <sandeeppati...@gmail.com> > wrote:
The common dialogs are simple wrappers around what the native API on each platform provides. This means that, depending on platform, most of the attributes and functionality inherited from wx.Dialog are simply ignored. Or even if wx is able to set the position the platform may still ignore it in certain situations in order to follow their own standards about dialog positioning or whatever.
On 11/29/10 10:07 PM, Sandeep wrote:
I have tried all the ways:
-> 'pos' argument do not work
-> 'CenterOnParent' do not work
-> 'SetPosition' do not workThese work only for wx.Dialog box, but not for wx.DirDialog,
wx.FileDialog and wx.MessageDialog boxes.
--
Robin Dunn
Software Craftsman