Git Product home page Git Product logo

Comments (6)

r0x0r avatar r0x0r commented on June 5, 2024

No you cannot do that.

I investigated it at some point, but did not find a solution. It might be possible though.

from pywebview.

MominIqbal-1234 avatar MominIqbal-1234 commented on June 5, 2024
def delete():
    gui_win = Tk()
    gui_win.withdraw() # remove the main TK window only show message box
    gui_win.iconbitmap('icon.ico')
    msg  = messagebox.askquestion("Message", "Are You Sure Delete Password \t")
    if msg =='yes':
            print("Delete data")
    gui_win.destroy()
    gui_win.mainloop()

from pywebview.

HariZalan avatar HariZalan commented on June 5, 2024

Why is this code related, @MominIqbal-1234 ?

from pywebview.

MominIqbal-1234 avatar MominIqbal-1234 commented on June 5, 2024

Since it's a desktop application, not a web application, integrating Tkinter should be straightforward. :)

import webview
from tkinter import *
from tkinter import messagebox
class Api():
  def delete(self, value):
        gui_win = Tk()
        gui_win.withdraw() # remove the main TK window only show message box
        msg  = messagebox.askquestion("Message", "Are You Sure \t")
        if msg =='yes':
                print("Delete data")
        gui_win.destroy()
        gui_win.mainloop()

webview.create_window("Test", html="<button onclick='pywebview.api.delete(\"Woah dude!\")'>Delete</button>", js_api=Api())
webview.start()

image

from pywebview.

Jzhenli avatar Jzhenli commented on June 5, 2024

No you cannot do that.

I investigated it at some point, but did not find a solution. It might be possible though.

pywebview is a lightweight cross-platform wrapper around a webview component that allows to display HTML content in its own native GUI window. Here why use the native gui window to instead of tkinter frame?? As we know, tkinter is a lightweight cross-platform gui too. @r0x0r

from pywebview.

Jzhenli avatar Jzhenli commented on June 5, 2024

hi, I find a project tkwebview2 which is based on the pywebview, and display the content on the tkinter frame. @r0x0r @PanosHatz

from pywebview.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.