![]() ![]() This code gets the layers loaded in QGIS and adds it to the comboBox object from the plugin dialog. But this is a lot more complicated I think the other solution will probably work a lot better for you. Make sure you select Qt Creator on the download page. Mixing waiting on multiprocessing async results with a tkinter event loop is a bit of a pain, but if you use concurrent.futures, you can just attach the create_image as a callback on the Future returned by the task.Ī different option is to have the background processes create off-screen Canvas objects, draw to them, then capture the results as a BitmapImage or a postscript rendering, which you can then pass to the main process to blit onto a Canvas of its own. ![]() ![]() So the only Canvas command you need is create_image.Īnd, in fact, you can probably do with tasks on a Pool, which just return the image when they're done, with the main process doing the create_image with the results. The simplest solution is to marshal your Canvas commands and pass them over a Pipe or Queue for the main process to execute.Ī fully general solution isn't that hard, but in your case, it should be even simpler: all you want the background process to do is process an image and then display it. However, that doesn't mean there's no way to do what you want, just that you can't do it directly. So, the result may be that nothing shows up, that one or both processes freezes, that the GUI doesn't respond to events, that tkinter raises an exception in the child, that tkinter creates a whole separate independent GUI, or, if you're really unlucky, that things unpredictably work sometimes but do one of the other things other times. On some platforms, it just isn't possible at all on other platforms, it would be possible, but only by doing things very differently from the way Tk does on others, it sort of works, but the event loops are all screwed up. Visual Studio Code outputted this in the console: ImportError: No. The place geometry manager positions widgets using absolute positioning. Python modules that realize the desired GUI. Required is PAGE is actually written in Tcl/Tk 8.6 which is embedded in tkinter. It allows one to easily create Python GUI windows containing a selection of Tk and ttk widgets. GUI widgets cannot be shared between processes. So - besides the obvious missing call to - which I suppose is what you intended with the call to (pygame.init already calls that one) - what I found out is that tkinter needs to initialize its windows and widgets before the packed frame is fully available to be used by Pygame. Activate the relevant python virtual environment. Tkinter has three built-in layout managers: the pack, grid, and place managers. Short Description PAGE is a cross-platform drag-and-drop GUI generator, bearing a resemblance to Visual Basic. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |