0

I'm trying to create a column where there's a number shown, and after clicking the number, a URL is opened in the browser. Each row in the column will correspond to a different URL. However the URL is too long to display in a cell of its own, as there are a number of other columns to fit, and showing it is just not necessary. What's the best way to invisibly save data (the URL) to a grid cell?

One approach which works is a global variable, just keeping a list of URLs.

Another would be if there was a way to set the URL to the balloon/hover/caption text of individual cells, but I don't think you can set custom ToolTips to cells in wxPython.

Any ideas? Thanks so much.

user2963623
  • 2,267
  • 1
  • 14
  • 25
User
  • 23,729
  • 38
  • 124
  • 207

1 Answers1

0

You can do something along these lines: Put all the urls in a dict using the numbers displayed in the grid as key.

a = {1:'http:\\www.google.com', 2:'http:\\www.twitter.com', 3:....}

Bind the selection events to an event handler which fetches the number shown in the selected cell and finds the corresponding url for that number from the dict.

user2963623
  • 2,267
  • 1
  • 14
  • 25