Drag and Drop

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Itsaku
    New Member
    • Mar 2008
    • 2

    Drag and Drop

    I was wondering how I could make a frame or an overrideredirec t(1) window able to be dragged? I just want it to be within another window not a canvas or anything.
  • chaosAD
    New Member
    • Feb 2008
    • 9

    #2
    wxpython mdi window might be what you are looking for? I'm not sure about tk i don't use it very often

    Code:
    import wx
    
    class ParentWindow(wx.MDIParentFrame):
    
        def __init__(self, parent, title):
    
            wx.MDIParentFrame.__init__(self, parent, -1, title)
    
            # create child window
            self.child = ChildWindow(self, "Hello I am a child window")
    
            self.SetSize((640,480))
    
    class ChildWindow(wx.MDIChildFrame):
        def __init__(self, parent, title):
            wx.MDIChildFrame.__init__(self, parent, wx.ID_ANY, title)
    
            self.SetSize((250,250))
            
            # display the window
            self.Show()
    
    
    def Main():
        app = wx.PySimpleApp()
        frame = ParentWindow(None, " Test MDI window ")
        frame.Show()
        app.MainLoop()
    
    if __name__ == '__main__':
        Main()

    Comment

    Working...