Changeset 858fabed in sasview for guiframe/utils.py


Ignore:
Timestamp:
Mar 20, 2009 8:31:29 PM (16 years ago)
Author:
Gervaise Alina <gervyh@…>
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:
200a6c5
Parents:
20d30e9
Message:

add small function in utils

File:
1 edited

Legend:

Unmodified
Added
Removed
  • guiframe/utils.py

    r4ba846b r858fabed  
    2020        output= "%-5.3g" % value 
    2121    return output.lstrip().rstrip() 
     22def check_value( item1, item2): 
     23    """ 
     24        Check 2 txtcrtl value  
     25        @param item1: txtcrtl containing the minimum value 
     26        @param item2: txtcrtl containing the maximum value 
     27    """ 
     28    mini = float(format_number(item1.GetValue())) 
     29    maxi = float(format_number(item2.GetValue())) 
     30    flag= True 
     31    if mini <  maxi:  
     32      item1.SetBackgroundColour(wx.WHITE) 
     33      item1.Refresh() 
     34    else: 
     35        flag = False 
     36        item1.SetBackgroundColour("pink") 
     37        item1.Refresh() 
     38       
     39    return flag 
     40    
     41     
     42     
    2243     
    2344class PanelMenu(wx.Menu): 
Note: See TracChangeset for help on using the changeset viewer.