[GRASS-dev] expanding [+] list on the GUI status bar

Daniel Calvelo dca.gis at gmail.com
Sun May 13 16:19:12 EDT 2007


[Hamish and Michael trying to find a way to fit more information on
the status line]
[...]
[Hamish]
> So what if we have a box at the bottom of the GUI that walks a like a
> status bar and talks like a status bar but is coded as a combobox or
> something similar?
>
> (IF an exanding list is really useful in the first place)

[Michael]
> I'm not convinced that it's worth the trouble to do.
[...]

The problem is that in order to behave (resizing and so on), it must
be a carefully crafted widget and be carefully inserted in the frame's
layout.

An easier solution would be to expand the statusbar widget
capabilities. It's actually a multiple-field one-liner. The one-liner
thing is its most cumbersome detail. I found no way in which it can be
made to hold more than one line. (It's probably feasible in the C++
wx, but I guess there is some reason why it has not been done in the
Python bindings, and we do NOT want to handle patches to a upstream
dependency, do we?)

We could add an info button, or a tooltip to the statusbar (I'd favor
the former) that pops up extended information about the display.

This, for instance, works:

import wx
class mySB(wx.StatusBar):
    def __init__(self,parent,id=wx.ID_ANY):
        wx.StatusBar.__init__( self, parent, id )
        self.SetFieldsCount(1)
        r=self.GetFieldRect(0)
        self.txt = wx.StaticText(self, label="first field" )
        self.txt.SetToolTipString( u"some\nlong\ntext" )
        self.txt.SetPosition( (r.x+2, r.y+2) )
app=wx.App(0)
f=wx.Frame(parent=None,size=(50,50))
f.SetStatusBar(mySB(f))
f.Show()
app.SetTopWindow(f)
app.MainLoop()

Daniel.

-- 
-- Daniel Calvelo Aros




More information about the grass-dev mailing list