Python Move() function in wxPython (original) (raw)
Last Updated : 10 May, 2020
In this particular article we will learn, how can we move our window to a particular point. This can be achieved using Move() function in wx.Window class of wxPython.
Move() takes x and y points to move window to a particularx, y point.
Syntax :
wx.Move(self, x, y, flags=SIZE_USE_EXISTING)
Parameters :
Parameter Input Type Description x int Required x position. y int Required y position. flag int flag for SetSize.
Code Example #1:
import
wx
class
MoveWindow(wx.Frame):
`` def
__init__(
self
, parent, title):
`` super
(MoveWindow,
self
).__init__(parent, title
=
title,
`` size
=
(
300
,
200
))
`` self
.Move((
500
,
250
))
def
main():
`` app
=
wx.App()
`` move
=
MoveWindow(
None
, title
=
'Move()'
)
`` move.Show()
`` app.MainLoop()
if
__name__
=
=
'__main__'
:
`` main()
Output:
Code Example #2:
import
wx
class
MoveWindow(wx.Frame):
`` def
__init__(
self
, parent, title):
`` super
(MoveWindow,
self
).__init__(parent, title
=
title,
`` size
=
(
300
,
200
))
`` self
.Move((
900
,
600
))
def
main():
`` app
=
wx.App()
`` move
=
MoveWindow(
None
, title
=
'Move()'
)
`` move.Show()
`` app.MainLoop()
if
__name__
=
=
'__main__'
:
`` main()
Output:
Similar Reads
- wxPython - Replace() function in wxPython Another function in wx.MenuBar class is Replace() function. If we ever want to replace a menu from menubar we use Replace() function. It takes three main parameters that is position of menu we want to replace, menu we want to add, title of new menu. Syntax : wx.MenuBar.Replace(self, pos, menu, title 2 min read
- Wand path_move() function in Python path_move() is another function introduced in wand for paths. The main aim of path_move() function is to set new starting point for a new sub_path. Given to parameter can be relative, or absolute, by setting the relative flag. Syntax : wand.drawing.path_move(to, relative) Parameters: Parameter Input 1 min read
- Python - Create() function in wxPython In this particular article we are going to learn about Create() function present in wx.Frame class. Create function is similar to Frame() constructor of wx.Frame class. Create function is used in two-step frame construction. Syntax : wx.Frame.Create(parent, id=ID_ANY, title="", pos=DefaultPosition, 1 min read
- wxPython | Exit() function in wxPython In this article we are going to learn about wx.Exit() which is a inbuilt parent function present in wxPython.Exit() function exits application after calling wx.App.OnExit . Should only be used in an emergency: normally the top-level frame should be deleted (after deleting all other frames) to termin 1 min read
- wxPython - SetBitmap() function in wxPython In this article we are going we are going to learn about SetBitmap() function associated with wx.MenuItem class of wxPython. SetBitmap() sets the bitmap for the menu item. SetBitmap must be called before the item is appended to the menu, i.e. appending the item without a bitmap and setting one later 1 min read
- Button in wxPython - Python In this article we are going to learn how can we add buttons to a frame in wxPython. This can be done by using the Button() constructor of wx.Button class. Following styles are supported in this class: wx.BU_LEFT: Left-justifies the label. Windows and GTK+ only.wx.BU_TOP: Aligns the label to the top 2 min read
- Python - GetMenu() function in wxPython In this particular article we are going to learn about GetMenu() function of wx.MenuBar class of wxPython. GetMenu() is function in wx.MenuBar class that return wx.Menu object present in Menubar. It needs only index of menu present on menubar. Syntax : wx.MenuBar.GetMenu(self, menuindex) Parameters 1 min read
- wxPython | GetMargins() function in python In this article we are going to learn about GetMargins() function of class wx.ToolBar in wxPython. GetMargins() function returns the left/right and top/bottom margins, which are also used for inter-toolspacing. GetMargins takes no parameters. Syntax: wx.ToolBar.GetMargins(self) Parameters: No Parame 2 min read
- wxPython | InsertSimpleTool() function in python In this article we are going to learn about InsertSimpleTool() function associated with wx.ToolBar class of wxPython. InsertSimpleTool() function is another old style method to insert a tool in the toolbar. InsertSimpleTool() function inserts the tool with the specified attributes into the toolbar a 2 min read
- wxPython| FindById() function in python In this article we are going to learn a simple function that is FindById() in wx.ToolBar class of wxPython. FindById is a simple function and returns a pointer to the tool identified by id or None if no corresponding tool is found. FindById() takes only single parameter that is id of a particular to 2 min read