wangyu190810 / cefpython

Automatically exported from code.google.com/p/cefpython
0 stars 0 forks source link

Use Tkinter for the Http Authentication dialog #26

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Currently http auth dialog is implemented only for windows platform, it uses 
some c++ code and calls win32 native api:

http://code.google.com/p/cefpython/source/browse/cefpython1/httpauth/

Tkinter comes by default with any python, we could use it to display that modal 
dialog on all the platforms (win, mac, linux) using the same code.

Googling "tkinter dialog example" and "tkinter modal dialog" finds us nice 
examples.

Original issue reported on code.google.com by czarek.t...@gmail.com on 14 Nov 2012 at 11:05

GoogleCodeExporter commented 9 years ago
Hm. What's the HttpAuth dialog for? You could just require a function as an
argument to CreateBrowser(), pass whatever in, and take whatever out. Sorry
if this doesn't apply; if you could point me towards more info or the
source on HttpAuth, I might be able to look into it more.

But I personally don't see a reason to have the dialog be part of the
webview code when the webview will just be embedded in another GUI
framework anyway. As a developer, I'd rather have control over the
look/feel/content of the Dialog anyway (I think), even if it'd be a bit of
extra work.

Original comment by rattray....@gmail.com on 15 Nov 2012 at 12:43

GoogleCodeExporter commented 9 years ago
Implementing a custom dialog is already possible, you need to overwrite 
RequestHandler::GetAuthCredentials(). We're only providing the default 
implementation that should work in most cases.

Original comment by czarek.t...@gmail.com on 15 Nov 2012 at 3:18

GoogleCodeExporter commented 9 years ago
I can't find a way to create a modal dialog in Tkinter for an existing 
non-tkinter window (in our case the browser). In all tkinter examples there 
must be a call to Tkinter.Tk() to create a root window, any dialog window can 
be attached only to this top level window, I don't see a way to attach it to 
the browser window by using native window handle (hwnd).

For the moment I don't think this is possible, we will have to provide OS 
specific implementations for the http auth dialog that use native api and can 
work with any gui framework being used by the application (pyqt, wxpython, 
tkinter).

If someone provides a tkinter modal dialog example that integrates with browser 
window then I might reopen this issue.

Original comment by czarek.t...@gmail.com on 16 Nov 2012 at 9:13