By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,675 Members | 2,270 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,675 IT Pros & Developers. It's quick & easy.

Drag and Drop

P: 2
I was wondering how I could make a frame or an overrideredirect(1) window able to be dragged? I just want it to be within another window not a canvas or anything.
Mar 30 '08 #1
Share this Question
Share on Google+
1 Reply


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

Expand|Select|Wrap|Line Numbers
  1. import wx
  2.  
  3. class ParentWindow(wx.MDIParentFrame):
  4.  
  5.     def __init__(self, parent, title):
  6.  
  7.         wx.MDIParentFrame.__init__(self, parent, -1, title)
  8.  
  9.         # create child window
  10.         self.child = ChildWindow(self, "Hello I am a child window")
  11.  
  12.         self.SetSize((640,480))
  13.  
  14. class ChildWindow(wx.MDIChildFrame):
  15.     def __init__(self, parent, title):
  16.         wx.MDIChildFrame.__init__(self, parent, wx.ID_ANY, title)
  17.  
  18.         self.SetSize((250,250))
  19.  
  20.         # display the window
  21.         self.Show()
  22.  
  23.  
  24. def Main():
  25.     app = wx.PySimpleApp()
  26.     frame = ParentWindow(None, " Test MDI window ")
  27.     frame.Show()
  28.     app.MainLoop()
  29.  
  30. if __name__ == '__main__':
  31.     Main()
Apr 3 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.