Changeset ef4a4ea in sasview for sansguiframe/src


Ignore:
Timestamp:
Aug 25, 2011 4:00:36 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:
bb64650
Parents:
e095c3a9
Message:

fixed add/remove text in plot: now it stays even when plot updates

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sansguiframe/src/sans/guiframe/local_perspectives/plotting/Plotter1D.py

    r886657f ref4a4ea  
    8686        self.graph.yaxis("\\rm{Intensity} ", "cm^{-1}") 
    8787        self.graph.render(self) 
    88         self.position = None 
     88         
    8989        # In resizing event 
    9090        self.resizing = False 
     
    257257        ax = event.inaxes 
    258258        if ax != None: 
     259            # data coordinate position 
    259260            pos_x = "%8.3g"% event.xdata 
    260261            pos_y = "%8.3g"% event.ydata 
    261             self.position = str(pos_x), str(pos_y) 
    262             position = "x: %s    y: %s" % (self.position) 
     262            position = "x: %s    y: %s" % (pos_x, pos_y) 
    263263            wx.PostEvent(self.parent, StatusEvent(status=position)) 
    264264        # unfocus all 
     
    421421        self._slicerpop.AppendSeparator() 
    422422         
    423         id = wx.NewId() 
    424         self._slicerpop.Append(id, '&Add text') 
    425         wx.EVT_MENU(self, id, self._on_addtext) 
    426         id = wx.NewId() 
    427         self._slicerpop.Append(id, '&Remove text') 
    428         wx.EVT_MENU(self, id, self._on_removetext) 
     423        if self.position != None: 
     424            id = wx.NewId() 
     425            self._slicerpop.Append(id, '&Add text') 
     426            wx.EVT_MENU(self, id, self._on_addtext) 
     427            id = wx.NewId() 
     428            self._slicerpop.Append(id, '&Remove text') 
     429            wx.EVT_MENU(self, id, self._on_removetext) 
    429430        id = wx.NewId() 
    430431        self._slicerpop.Append(id, '&Change scale') 
Note: See TracChangeset for help on using the changeset viewer.