Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Python Geospatial Development Essentials

You're reading from   Python Geospatial Development Essentials Utilize Python with open source libraries to build a lightweight, portable, and customizable GIS desktop application

Arrow left icon
Product type Paperback
Published in Jun 2015
Publisher
ISBN-13 9781782175407
Length 192 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Karim Bahgat Karim Bahgat
Author Profile Icon Karim Bahgat
Karim Bahgat
Arrow right icon
View More author details
Toc

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...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at £13.99/month. Cancel anytime
Visually different images