Changeset 280:4d2a277c703b
- Timestamp:
- 07/07/12 09:40:23 (12 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- src/mlx/gui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/gui/callouts.py
r272 r280 156 156 self._fileList.set_size_request(300, -1) 157 157 self._fileList.set_reorderable(False) 158 self._fileList.connect("button-press-event", 159 self._fileListButtonPressed) 158 160 selection = self._fileList.get_selection() 159 161 selection.set_mode(SELECTION_MULTIPLE) 160 162 selection.connect("changed", self._fileListSelectionChanged) 161 163 164 self._buildFileListPopupMenu() 165 162 166 scrolledWindow = gtk.ScrolledWindow() 163 167 scrolledWindow.add(self._fileList) … … 228 232 def _removeButtonClicked(self, button): 229 233 """Called when the Remove button is clicked.""" 234 self._removeSelected() 235 236 def _removeSelected(self): 237 """Remove the selected files.""" 230 238 selection = self._fileList.get_selection() 231 239 (model, paths) = selection.get_selected_rows() … … 436 444 return value 437 445 446 def _fileListButtonPressed(self, widget, event): 447 """Called when a mouse button is pressed on the file list.""" 448 if event.type!=EVENT_BUTTON_PRESS or event.button!=3: 449 return 450 451 menu = self._fileListPopupMenu 452 if pygobject: 453 menu.popup(None, None, None, None, event.button, event.time) 454 else: 455 menu.popup(None, None, None, event.button, event.time) 456 457 def _buildFileListPopupMenu(self): 458 """Build the file list popup menu.""" 459 menu = gtk.Menu() 460 461 menuItem = gtk.MenuItem() 462 menuItem.set_label(xstr("callouts_remove")) 463 menuItem.set_use_underline(True) 464 menuItem.connect("activate", self._popupRemove) 465 menuItem.show() 466 self._popupRemoveItem = menuItem 467 468 menu.append(menuItem) 469 470 self._fileListPopupMenu = menu 471 472 def _popupRemove(self, menuItem): 473 """Remove the currently selected menu items.""" 474 self._removeSelected() 475 438 476 #------------------------------------------------------------------------------ -
src/mlx/gui/checklist.py
r279 r280 318 318 return 319 319 320 # (path, _, _, _) = self._flightList.get_path_at_pos(int(event.x),321 # int(event.y))322 # selection = self._flightList.get_selection()323 # selection.unselect_all()324 # selection.select_path(path)325 326 320 menu = self._fileListPopupMenu 327 321 if pygobject: … … 331 325 332 326 def _buildFileListPopupMenu(self): 333 """ Getthe file list popup menu."""327 """Build the file list popup menu.""" 334 328 menu = gtk.Menu() 335 329
Note:
See TracChangeset
for help on using the changeset viewer.