wx.DragTreeItem problem

Hi.

Can't create wx.DragTreeItem, look at this:

class FolderTree(wx.TreeCtrl):
[snip]
  wx.EVT_TREE_BEGIN_DRAG(self, ID_TREE, self.OnBeginDrag)
[snip]
  def OnBeginDrag(self, event):
           self.dragging_item = event.GetItem()
    self.drag_image = wx.DragTreeItem(self, self.dragging_item)

And here bails out with an error:
Traceback (most recent call last):
   File "C:\Piotr\pynerd\email_pane.py", line 137, in OnBeginDrag
     self.drag_image = wx.DragTreeItem(self, self.dragging_item)
   File "C:\Python23\lib\site-packages\wxPython\misc2.py", line 324, in wxDragTreeItem
     val = wxDragImagePtr(misc2c.new_wxDragTreeItem(*_args,**_kwargs))
TypeError: Type error in argument 1 of new_wxDragTreeItem. Expected _wxTreeCtrl_p.

What I'm doing wrong?

Hi,

How do I set the background color of a wxTextCtrl (supporting wxTE_RICH
style) to grey ???
The following patch of code does not set the background color to grey !
/*********************************/
wxTextAttr* m_textAttrib = new wxTextAttr(wxNullColour,

*wxLIGHT_GREY,

*m_font);

m_txtData->SetDefaultStyle(*m_textAttrib);
/********************************/

- Shruti

···

----- Original Message -----
From: Piotr Wa¶kiewicz <piter@lameriada.com>
To: <wxPython-users@lists.wxwindows.org>
Sent: Tuesday, November 18, 2003 8:34 PM
Subject: [wxPython-users] wx.DragTreeItem problem

Hi.

Can't create wx.DragTreeItem, look at this:

class FolderTree(wx.TreeCtrl):
[snip]
wx.EVT_TREE_BEGIN_DRAG(self, ID_TREE, self.OnBeginDrag)
[snip]
def OnBeginDrag(self, event):
         self.dragging_item = event.GetItem()
self.drag_image = wx.DragTreeItem(self, self.dragging_item)

And here bails out with an error:
Traceback (most recent call last):
   File "C:\Piotr\pynerd\email_pane.py", line 137, in OnBeginDrag
     self.drag_image = wx.DragTreeItem(self, self.dragging_item)
   File "C:\Python23\lib\site-packages\wxPython\misc2.py", line 324, in
wxDragTreeItem
     val = wxDragImagePtr(misc2c.new_wxDragTreeItem(*_args,**_kwargs))
TypeError: Type error in argument 1 of new_wxDragTreeItem. Expected
_wxTreeCtrl_p.

What I'm doing wrong?

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org

Piotr Was'kiewicz wrote:

Hi.

Can't create wx.DragTreeItem, look at this:

class FolderTree(wx.TreeCtrl):
[snip]
    wx.EVT_TREE_BEGIN_DRAG(self, ID_TREE, self.OnBeginDrag)
[snip]
    def OnBeginDrag(self, event):
            self.dragging_item = event.GetItem()
        self.drag_image = wx.DragTreeItem(self, self.dragging_item)

And here bails out with an error:
Traceback (most recent call last):
  File "C:\Piotr\pynerd\email_pane.py", line 137, in OnBeginDrag
    self.drag_image = wx.DragTreeItem(self, self.dragging_item)
  File "C:\Python23\lib\site-packages\wxPython\misc2.py", line 324, in wxDragTreeItem
    val = wxDragImagePtr(misc2c.new_wxDragTreeItem(*_args,**_kwargs))
TypeError: Type error in argument 1 of new_wxDragTreeItem. Expected _wxTreeCtrl_p.

What I'm doing wrong?

Nothing. There is a bug in the wrappers.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Shruti Mahambre wrote:

Hi,

How do I set the background color of a wxTextCtrl (supporting wxTE_RICH
style) to grey ???
The following patch of code does not set the background color to grey !
/*********************************/
wxTextAttr* m_textAttrib = new wxTextAttr(wxNullColour,

*wxLIGHT_GREY,

*m_font);

m_txtData->SetDefaultStyle(*m_textAttrib);
/********************************/

First, this is a Python list, not C++.

Second, please don't reply to an existing message to start a new thread, start a new message instead. (It screws up sorting messages by thread.)

Third, if you want to set the background for the whole control then use SetBackgroundColour.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Robin Dunn wrote:

What I'm doing wrong?

Nothing. There is a bug in the wrappers.

Ooops. Any plans to fix this?

Piotr Was'kiewicz wrote:

Robin Dunn wrote:

What I'm doing wrong?

Nothing. There is a bug in the wrappers.

Ooops. Any plans to fix this?

Yes, I've made the changes already, although I havn't recompiled/tested the 2.4 version yet.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Robin Dunn wrote:

Ooops. Any plans to fix this?

Yes, I've made the changes already, although I havn't recompiled/tested the 2.4 version yet.

Great, thank you. :slight_smile: