Skip to content
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

Update wResizer.nim #120

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Update wResizer.nim #120

wants to merge 1 commit into from

Conversation

retsyo
Copy link

@retsyo retsyo commented Jan 19, 2024

fix this issue

wNim\private\wResizer.nim(178, 33) Error: ambiguous identifier: 'wResizable' -- use one of the following:
  wTypes.wResizable: wResizable
  wnim.wResizable:

fix this issue
```
wNim\private\wResizer.nim(178, 33) Error: ambiguous identifier: 'wResizable' -- use one of the following:
  wTypes.wResizable: wResizable
  wnim.wResizable:
```
@retsyo
Copy link
Author

retsyo commented Jan 19, 2024

you can meet this issue in this code

import winim
import wnim

let app = App(wSystemDpiAware)
let mainForm = Frame()
let panel = Panel(mainForm)

let plus_c = StaticText(panel, label="Hello",  )

proc reSize(ratioX: float, ratioY: float): void =
    plus_c.setPosition( int(16 * ratioX), int(21 * ratioY) )
    plus_c.setSize( int((549-16) * ratioX), int((440-21) * ratioY) )

proc reSizeFont(ratioF: float=1): void =
    plus_c.font = Font(pointSize=9 * ratioF)

mainForm.wEvent_Size do ():
    var
        xy = mainForm.getSize
        x = xy[0]
        y = xy[1]

    var
        ratioX = 0.0
        ratioY = 0.0
        ratioF = 0.0

    panel.setSize(xy)
    ratioX = x / (600+21)
    ratioY = y / (470+47)

    if ratioX >= 1 and ratioY >= 1:
        ratioF = min(ratioX, ratioY)
        reSize(ratioX, ratioY)
        reSizeFont(ratioF)

reSize(1, 1)

mainForm.center
mainForm.show()

app.mainLoop()

@veksha
Copy link

veksha commented Jan 28, 2024

reproduces for me too. even with just import wnim/wframe

wnim  [(version: 0.13.3, checksum: eba76f28624eb4c74bdda19830fae74d4dbc1ee2)]
>nim --version
Nim Compiler Version 2.1.1 [Windows: amd64]
Compiled at 2024-01-27
Copyright (c) 2006-2024 by Andreas Rumpf

git hash: f7c6e04cfbc44c225c123d724745840585561ac5
active boot switches: -d:release
>nimble --version
nimble v0.14.2 compiled at 2024-01-27 05:15:25
git hash: a1fdbe8912a0e3dfd30cef030bbabef218d84687

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants