Open soegaard opened 7 years ago
This probably belongs on the racket/gui repo; I think that DrRacket would just inherit the behavior of the underlying tab:panel%
Is tab-panel% in https://github.com/racket/gui/blob/master/gui-lib/mred/private/mrpanel.rkt the correct class?
Okay, I've got a proposal for how this API could work. I've been mulling over it for a week, and cross-comparing it to how other gui apis work, so I'm pretty confidant in how it looks, but, of course, I'd love feedback.
Ok, so first things first, we would add 'draggable
as an option in style:
(new tab-panel%
...
[style '(draggable)])
This would add inherent backwards compatibility with how it is now.
Second, there would be one of these two ways of getting the event (honestly, I don't know which would be better, but I prefer the way number 1 looks):
I'd like to make note, though. When I was brainstorming this, I didn't even think about tab-panel to tab-panel drags until really late, so I'm not confidant in that part. Perhaps it could still only be two numbers, but the third arg is the source panel? I don't know.
The signature for that last bit would be (-> exact-nonnegative-integer? (or/c -1 exact-nonnegative-integer?) (is-a/c? tab-panel%)) void?)
Ah. Wrong repo. My bad. Let me put this in the right one...
@Lazerbeak12345 probably a good next step is to look at the libraries that are used to implement the current tab panel and see what functionality they offer, see if there is a common set of it, and then design the racket-level api around that.
Yeah... good idea. If I can I do want to give a pr for this a try, but I'd only be able to test the gtk stuff, so I simply won't write code I can't test. :)
Though, that actually does bring up an interesting problem: what if the api I end up pr-ing is only convenient to write back-end for on gtk (as I won't be able to do win32 or cocoa stuff)? I take it that would be looked over in the review, @rfindler ?
I think @rfindler's suggestion is that you should look at what the mac and windows APIs for tabs provide (as in the documentation) and then try to design the API around that.
Yes, exactly (but in the case of the mac, it is a third party library that we use, not the OS proper).
I think this works in recent versions of DrRacket.
Time to close?
It does work, last I tried. I do think this can be closed.
A feature request: implement reordering of tabs via drag and drop.