Changeset bacc04b in sasview for src/sas


Ignore:
Timestamp:
Dec 2, 2016 6:05:58 AM (8 years ago)
Author:
wojciech
Children:
075c460
Parents:
fbfed45
Message:

Switched to checkbox, beacuase all of them can be unset during initialization

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/perspectives/fitting/gpu_options.py

    rfbfed45 rbacc04b  
    3535        boxsizer = wx.BoxSizer(orient=wx.VERTICAL) 
    3636        self.option_button = {} 
     37        self.buttons = [] 
    3738        for index, clopt in enumerate(clinfo): 
    38             button = wx.RadioButton(self.panel1, -1, label=clopt, name=clopt) 
    39             button.SetValue(0) 
     39            button = wx.CheckBox(self.panel1, -1, label=clopt, name=clopt) 
    4040            if clopt != "No OpenCL": 
    4141                self.option_button[clopt] = str(index) 
    4242            else: 
    4343                self.option_button[clopt] = "None" 
    44             self.Bind(wx.EVT_RADIOBUTTON, self.on_radio, id=button.GetId()) 
     44            self.Bind(wx.EVT_CHECKBOX, self.on_radio, id=button.GetId()) 
     45            self.buttons.append(button) 
    4546            boxsizer.Add(button, 0, 0) 
    4647 
     
    100101        :return: 
    101102        """ 
    102  
    103103        import sasmodels 
    104         button = event.GetEventObject() 
    105         os.environ["SAS_OPENCL"] = self.option_button[button.Name] 
     104        selected_button = event.GetEventObject() 
     105        for btn in self.buttons: 
     106            if btn != selected_button: 
     107                btn.SetValue(0) 
     108        os.environ["SAS_OPENCL"] = self.option_button[selected_button.Name] 
    106109        sasmodels.kernelcl.ENV = None 
    107110        #Need to reload sasmodels.core module to account SAS_OPENCL = "None" 
Note: See TracChangeset for help on using the changeset viewer.