Skip to content

macro cant choose what to use gtk4.Window00 or adw.Window00 when using connect signal with LibAdwaita #188

@gavr123456789

Description

@gavr123456789

Here minimal example:

import gintro/[gtk4, gobject, gio, pango, adw]
import std/with

proc windowOnClose(self: PreferencesWindow, mainWindow: adw.ApplicationWindow) = 
  mainWindow.close()

proc activate(app: gtk4.Application) =
  adw.init()
  let mainWindow = adw.newApplicationWindow(app)

  let
    window = adw.newPreferencesWindow()

  window.connect("close_request", windowOnClose, mainWindow)
  with window:
    # add createPage(window)
    title = "Main"
    defaultSize = (100, 400)
    show

proc main() =
  let app = newApplication("org.gtk.example")
  app.connect("activate", activate)
  discard run(app)

main()

Here I want to main window close when preference window close.
Error:

> nimble run
  Verifying dependencies for TaskManager@0.1.0
      Info: Dependency on gintro@any version already satisfied
  Verifying dependencies for gintro@0.9.5
   Building TaskManager/TaskManager using c backend
/home/gavr/Projects/Nim/gtk-task-manager/src/TaskManager.nim(15, 9) template/generic instantiation of `connect` from here
/usr/lib/nim/core/macros.nim(557, 56) Error: ambiguous identifier: 'Window00' -- use one of the following:
  gtk4.Window00: Window00
  adw.Window00: Window00
       Tip: 3 messages have been suppressed, use --verbose to show them.
     Error: Build failed for package: TaskManager
        ... Execution failed with exit code 1
        ... Command: /usr/bin/nim c --colors:on --noNimblePath -d:NimblePkgVersion=0.1.0 --path:/home/gavr/.nimble/pkgs/gintro-0.9.5 --hints:off -o:/home/gavr/Projects/Nim/gtk-task-manager/TaskManager /home/gavr/Projects/Nim/gtk-task-manager/src/TaskManager.nim

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions