Book Image

Python Geospatial Development Essentials

By : Karim Bahgat
Book Image

Python Geospatial Development Essentials

By: Karim Bahgat

Overview of this book

Table of Contents (15 chapters)
Python Geospatial Development Essentials
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Weaving functionality into the user interface


Now, we get to the part where we can make the management functionality created earlier accessible to the user in the visual user interface.

Layer-specific right-click functions

Some of the functionality we created in this chapter is intrinsically bound to only one layer, so it makes sense to make these available directly by right-clicking on the desired layer to operate on. Such a feature is only specific to the application we are currently making, so let's define this right-click menu in the app/dialogues.py module. Since Tkinter already has such a nicely formatted popup menu widget, with easy methods for adding items and commands, all we need to do is subclass it. Vector and raster layers will each get their own menu, but both will have in common items called as Rename, Save as, and Properties. To give them better visuals, find the three .png images with the same names as each of these items so we can assign them to the menu items, saving them...