If you're manually processing events, this is

switch e := w.NextEvent().(type) {
case size.Event:
    dpi := float64(e.PixelsPerPt) * unit.PointsPerInch
}

If you're writing your own widget, Paint and PaintBase methods receive
either a PaintContext or PaintBaseContext argument respectively; call
ctx.Theme.GetDPI(). Better, OnMeasure method receives the Theme argument
directly; just make sure your widget is being used in such a way this
method is called.

On Wed, Jul 12, 2017 at 12:10 AM <djad...@gmail.com> wrote:

> Hi All,
> Question is in subject,
> May be i miss something obvious, but cant find how to get DPI
>
> golang.org/x/exp/shiny/screen  doesn't mention anyting about dpi or
> resolution.
>
> thanks in advance,
> Djadala
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to