Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Examples #1584

Merged
merged 10 commits into from Sep 8, 2018
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 5 additions & 6 deletions dipy/viz/ui.py
Expand Up @@ -458,7 +458,7 @@ def set_icon_by_name(self, icon_name):
"""
icon_id = self.icon_names.index(icon_name)
self.set_icon(self.icons[icon_id][1])

def set_icon(self, icon):
""" Modifies the icon used by the vtkTexturedActor2D.

Expand Down Expand Up @@ -2993,7 +2993,7 @@ def __init__(self, label, position=(0, 0), font_size=18):
self.button_size = (font_size * 1.2, font_size * 1.2)
self.button_label_gap = 10
super(Option, self).__init__(position)

# Offer some standard hooks to the user.
self.on_change = lambda obj: None

Expand Down Expand Up @@ -3048,7 +3048,7 @@ def _set_position(self, coords):
(0, num_newlines * self.font_size * 0.5)
offset = (self.button.size[0] + self.button_label_gap, 0)
self.text.position = coords + offset

def toggle(self, i_ren, obj, element):
if self.checked:
self.deselect()
Expand All @@ -3061,7 +3061,7 @@ def toggle(self, i_ren, obj, element):
def select(self):
self.checked = True
self.button.set_icon_by_name("checked")

def deselect(self):
self.checked = False
self.button.set_icon_by_name("unchecked")
Expand Down Expand Up @@ -3123,7 +3123,7 @@ def _setup(self):

# Set callback
option.on_change = self._handle_option_change

def _get_actors(self):
""" Get the actors composing this UI component.
"""
Expand Down Expand Up @@ -3588,7 +3588,6 @@ def left_button_clicked(self, i_ren, obj, list_box_item):
range_select = i_ren.event.shift_key
self.list_box.select(self, multiselect, range_select)
i_ren.force_render()
i_ren.event.abort() # Stop propagating the event.


class FileMenu2D(UI):
Expand Down