Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
drop problem with grid -- on Mac only?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Brian H. Toby  
View profile  
 More options Sep 25 2010, 10:40 am
From: "Brian H. Toby" <Brian.T...@ANL.gov>
Date: Sat, 25 Sep 2010 09:40:14 -0500
Local: Sat, Sep 25 2010 10:40 am
Subject: drop problem with grid -- on Mac only?

I have been having problems getting drag & drop to work, where I drag into a grid on a Mac. I have constructed a <60 line demo program that works on Windows and Linux, but where dragging to the grid on my Mac (10.6.4, EPD 6.2-2) fails. Is this operator error or is there a wx bug here?

As a second question, since I am still struggling to learn proper use of sizers, can anyone explain to me why the commented out BoxSizer Add fails to cause the TextCtrl to expand to its proper size, if it is used in place of the previous Add?

Brian

  testdrop.py
1K Download

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Robin Dunn  
View profile  
 More options Sep 27 2010, 12:22 pm
From: Robin Dunn <ro...@alldunn.com>
Date: Mon, 27 Sep 2010 09:22:16 -0700
Local: Mon, Sep 27 2010 12:22 pm
Subject: Re: [wxPython-users] drop problem with grid -- on Mac only?
On 9/25/10 7:40 AM, Brian H. Toby wrote:

> I have been having problems getting drag&  drop to work, where I drag
> into a grid on a Mac. I have constructed a<60 line demo program that
> works on Windows and Linux, but where dragging to the grid on my Mac
> (10.6.4, EPD 6.2-2) fails. Is this operator error or is there a wx
> bug here?

The Grid widget is composed of several sub widgets (for the grid area
and the col/row labels), which occupy all the visible area of the grid.
  If you want to be able to drop into the grid you should set the drop
target on one of the visible windows, not its parent.

     grid.GetGridWindow().SetDropTarget(drptgt)

> As a second question, since I am still struggling to learn proper use
> of sizers, can anyone explain to me why the commented out BoxSizer
> Add fails to cause the TextCtrl to expand to its proper size, if it
> is used in place of the previous Add?

Depends on what you mean by "proper size."  I'm guessing that you think
it means to be large enough to show all the text.  But since the
wx.TextCtrl can have variable size needs that change at runtime as the
user types then it just uses a fixed width for its best size and that is
what the sizer will use for layout unless you tell it different.  You
can override the best size by setting the min size.

     lbl1.SetMinSize((200,-1))

--
Robin Dunn
Software Craftsman
http://wxPython.org


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
bht  
View profile  
 More options Sep 27 2010, 5:50 pm
From: bht <brian.t...@anl.gov>
Date: Mon, 27 Sep 2010 14:50:51 -0700 (PDT)
Local: Mon, Sep 27 2010 5:50 pm
Subject: Re: drop problem with grid -- on Mac only?
Ah ha! Thanks this is indeed the solution:

>   If you want to be able to drop into the grid you should set the drop
> target on one of the visible windows, not its parent.

>      grid.GetGridWindow().SetDropTarget(drptgt)

So I take it that the GridDragAndDrop.py example:

class SimpleGrid(gridlib.Grid):
    def __init__(self, parent, log):
        gridlib.Grid.__init__(self, parent, -1)
...
        # set the drag and drop target
        dropTarget = GridFileDropTarget(self)
        self.SetDropTarget(dropTarget)

is wrong. (How to get that changed?) To help others avoid this
pitfall, I have made appropriate (I hope) updates to http://wiki.wxpython.org/wxGrid
and http://wiki.wxpython.org/AppointmentsSchedulingWidget where the
similar problematic usage is present.

Brian


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Robin Dunn  
View profile  
 More options Sep 27 2010, 6:12 pm
From: Robin Dunn <ro...@alldunn.com>
Date: Mon, 27 Sep 2010 15:12:59 -0700
Local: Mon, Sep 27 2010 6:12 pm
Subject: Re: [wxPython-users] Re: drop problem with grid -- on Mac only?
On 9/27/10 2:50 PM, bht wrote:

Apparently not as that sample works fine on Mac for me, I guess I was
misremembering something.  Try to figure out what the difference is
between your sample and the one in the demo, so we can narrow down where
the problem is at.

--
Robin Dunn
Software Craftsman
http://wxPython.org


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Robin Dunn  
View profile  
 More options Sep 27 2010, 6:18 pm
From: Robin Dunn <ro...@alldunn.com>
Date: Mon, 27 Sep 2010 15:18:13 -0700
Local: Mon, Sep 27 2010 6:18 pm
Subject: Re: [wxPython-users] Re: drop problem with grid -- on Mac only?
On 9/27/10 3:12 PM, Robin Dunn wrote:

Oops, what I was missing is that I ran one sample with wx 2.8 and the
other with 2.9.  In 2.9 this issue has been solved, and setting the Grid
as the drop target on Mac will also work for drops done on the GridWindow.

--
Robin Dunn
Software Craftsman
http://wxPython.org


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »