I can think of two options which only use the functionality that is 
currently
available in the racket GUI library:

One option is to use a `pasteboard%` instead of the `canvas%` and use an
`editor-snip%` for the text input, with the snip being moved where you need
it.  This solution will be limited to the text input widget only, unless you
want to write additional widgets, which will have to be implemented as 
`snip%`
instances.

Another option is to write your own panel widget by deriving from `panel%` 
and
overriding `container-size` and `place-children` -- this will give full
control over the placement of child items inside the panel: e.g. the canvas
could be placed at 0,0 and fill the entire client area, while the text input
will be placed on top of the canvas at the correct position.  This solution
allows placing arbitrary controls on the canvas.  For scrolling, I would
suggest making the canvas itself scrollable and have the panel update the
position of the text input: a scrollable panel works, but the canvas will 
not
know its viewing area and will have to draw all the rows and let the
underlying draw routines clip them -- this might be a performance issue for
very large number of rows.

Good luck with your project,
Alex.

On Monday, August 5, 2019 at 7:28:17 PM UTC+8, Neil Van Dyke wrote:
>
> For a million-rows spreadsheet GUI widget that's based on a canvas, and 
> wants to overlay a single normal widget like a `text-field%` at a time, 
> over the canvas, for cell value editing... what's the best way to get 
> that overlay to happen in Racket `gui`? 
>
> One idea: in the implementation of `panel%`, looks like I can force it 
> to be implemented as a canvas (`wx-vertical-canvas-panel%`).  If I could 
> draw the spreadsheet viewport to that same canvas, as well as parent 
> overlaid widgets to it, I suppose I could use panes to position and size 
> the editing widget.  I don't know whether that would work at all, on all 
> platforms, and in future Racket releases. 
>
> Or is there a better way? 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/3b932c2d-c6c2-48ea-8906-605695579fe2%40googlegroups.com.

Reply via email to