Changeset fd9a815 in sasview


Ignore:
Timestamp:
Jun 23, 2011 2:37:21 PM (13 years ago)
Author:
Jae Cho <jhjcho@…>
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
f726a63
Parents:
dfbc3eb
Message:

custom sorting for source_cb

File:
1 edited

Legend:

Unmodified
Added
Removed
  • calculatorview/perspectives/calculator/resolution_calculator_panel.py

    rdfbc3eb rfd9a815  
    131131                                style=wx.CB_READONLY, 
    132132                                name = '%s'%mass_value) 
     133        # Sort source name because wx2.9 on Mac does not support CB_SORT 
     134        # Custom sorting 
     135        source_list = [] 
    133136        for key, value in self.source_mass.iteritems(): 
    134137            name_source = str(key) 
    135             self.source_cb.Append(name_source, name_source) 
     138            source_list.append(name_source) 
     139        source_list.sort() 
     140        for idx in range(len(source_list)): 
     141            self.source_cb.Append(source_list[idx],idx) 
    136142        self.source_cb.SetStringSelection("Neutron")  
     143         
    137144        wx.EVT_COMBOBOX(self.source_cb,-1, self._on_source_selection)       
    138145        source_hint = "Source Selection: Affect on" 
Note: See TracChangeset for help on using the changeset viewer.