35
35
import inspect
36
36
import json
37
37
import os
38
+ import platform
38
39
39
40
# Third party imports
40
41
from PIL import Image , ImageTk
@@ -335,8 +336,13 @@ def draw_feature_list_graph(self, new_list_flag=True):
335
336
336
337
btn .grid (row = 0 , column = i * 2 , sticky = "" , pady = (30 , 0 ))
337
338
btn ["width" ] = 20
338
- # right click
339
- btn .bind ("<Button-3>" , self .show_menu (i , flag ))
339
+
340
+ # Right-Click Bindings
341
+ if platform .system () == "Darwin" :
342
+ btn .bind ("<ButtonPress-2>" , self .show_menu (i , flag ))
343
+ else :
344
+ btn .bind ("<Button-3>" , self .show_menu (i , flag ))
345
+
340
346
if i == 0 :
341
347
self .feature_list_view .update ()
342
348
feature_icon_width = btn .winfo_width ()
@@ -355,7 +361,6 @@ def draw_feature_list_graph(self, new_list_flag=True):
355
361
# draw loop arrows
356
362
image_width = feature_icon_width * (l + 1 ) + al_width * l
357
363
image_height = self .calculate_arrow_image_height ()
358
- arrow_height = 50
359
364
stack = []
360
365
arrow_image = None
361
366
space = 30
@@ -418,6 +423,7 @@ def draw_feature_list_graph(self, new_list_flag=True):
418
423
end_pos = c * (feature_icon_width + al_width ) + feature_icon_width // 2
419
424
if arrow_image :
420
425
image_gif = arrow_image .convert ("P" , palette = Image .ADAPTIVE )
426
+
421
427
#: ImageTk.PhotoImage: The image of the feature list graph.
422
428
self .image = ImageTk .PhotoImage (image_gif )
423
429
al = tk .Label (self .feature_list_view , image = self .image )
@@ -433,7 +439,7 @@ def show_config_popup(self, idx):
433
439
434
440
Returns
435
441
-------
436
- func
442
+ func : function
437
443
The function to show the feature configuration popup
438
444
"""
439
445
feature = self .features [idx ]
@@ -534,11 +540,6 @@ def update_feature_parameters(popup):
534
540
----------
535
541
popup : navigate.view.popups.feature_list_popup.FeatureConfigPopup
536
542
The feature configuration popup
537
-
538
- Returns
539
- -------
540
- func
541
- The function to update the feature parameters
542
543
"""
543
544
widgets = popup .get_widgets ()
544
545
feature_name = popup .feature_name_widget .get ()
@@ -581,10 +582,12 @@ def show_menu(self, idx, flag=True):
581
582
----------
582
583
idx : int
583
584
The index of the feature
585
+ flag : bool, optional
586
+ Whether the feature is a decision node, by default True
584
587
585
588
Returns
586
589
-------
587
- func
590
+ func : function
588
591
The function to show the popup menu
589
592
"""
590
593
@@ -688,11 +691,6 @@ def insert_after(idx):
688
691
----------
689
692
idx : int
690
693
The index of the feature
691
-
692
- Returns
693
- -------
694
- func
695
- The function to insert the feature after the current feature
696
694
"""
697
695
self .features .insert (
698
696
idx ,
@@ -715,14 +713,9 @@ def insert_after(idx):
715
713
def calculate_arrow_image_height (self ):
716
714
"""Calculate the height of the arrow image
717
715
718
- Parameters
719
- ----------
720
- feature_structure : list
721
- The feature structure
722
-
723
716
Returns
724
717
-------
725
- int
718
+ image_height : int
726
719
The height of the arrow image
727
720
"""
728
721
image_height = 0
@@ -740,7 +733,7 @@ def build_feature_list_text(self):
740
733
741
734
Returns
742
735
-------
743
- str
736
+ content : str
744
737
The feature list text
745
738
"""
746
739
content = "["
0 commit comments