-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to specify custom cursor images? #39
Comments
Under which platform? |
Both Linux and Windows ;) If this is not possible, is there a way to statically replace the used cursor images during compile time (again both for Linux and Windows)? For Unix, I guess editing |
Do you have a solution for either Linux or Windows? |
TkDND version 1.x used to support custom icons. In the 2.x series it is not supported at all. The problem is that a cross-platform API is the main focus. So, I need to design such a cross platform API. If you could propose an API, what would it be? If I remember correctly:
What do you want your application to do? Starting a drag begins always on a Tk window. How do you imagine this image to be created? |
You also mentioned cursors. This is an entirely different issue: drags can have both a cursor and an image. |
In our application (http://www.concept.de/StarVision.html), DnD is one of the main ways for the user to interact with the GUI, e.g. you can select an drag circuit elements from one view and drop the into another view. We are in the process of updating or software to use the latest upstream TkDND version - everything's working fine (and the needed glue code even got a lot simpler), except the "change the cursor" functionality. |
Thank you very much, now I understand better! Just a question: how do you load these cursors in the application under the operating systems you need to support? |
We're doing low-level stuff to load/set cursors: On X11/Linux, cursors are loaded via On Windows, we transform the same static |
Are these cursors available as a cursor Tk can use? I am trying to think of a way to give these cursors to tkdnd. One way is to create these cursors inside tkdnd, so tkdnd can assign names (and use them). |
Can you share the parts of the code you create the cursors under windows & unix, to put them in tkdnd? |
Our Unix code is basically what's already in On Windows, we're transforming these static XBMs into Windows compatible AND/XOR-planes and then create a HCURSOR from that:
On Windows, the cursor current cursor is controlled by the drag source, via |
I have committed some changes that add support for custom images under linux (build it with cmake).
The example uses both, the callback is called after the map. Do you think that such an interface will work in your case? I mean having the files loaded from a folder, as Tk wants? |
Make sure you have Xcursor lib & dev files installed, as I have written some code that uses also this (but needs work as I have no idea if the cursors are cached...) |
Thanks, I'll look into it. |
I finally managed to integrate the custom cursor code into our application. Works great - even with loading cursor images from a virtual file-system (a zip-based file-system wrapped into the application binary). Here's a quick screencast of the custom cursors in action: |
Nice. Is there anything that cannot be done with the current code? |
No, we're quite happy with the current implementation. |
Is there any way for the drag source to specify a custom cursor image when starting a drag operation
(e.g. a dynamically created thumbnail representation of the dragged object/data)?
The text was updated successfully, but these errors were encountered: