On 9/11/13 8:41 AM, Ricardo Aráoz wrote:
> How can I set the initial width of my grid columns to the user's last
> selection?
> I can see that the widths are being written in my prefs table, but I've not
> been able
> to find a straightforward way of setting them in my app. Is there a grid
> toggle or
> something?
>
> BTW, before app.start() I'm setting my preferences database this way. Maybe
> I'm doing
> something wrong here?
>
> ci = dabo.db.dConnectInfo(DbType='SQLite')
>
> ci.Database = os.path.join('db', 'Seteos.db')
>
> try:
>
> conn = dabo.db.dConnection(ci)
>
> except dException.DBFileDoesNotExistException:
>
> conn = sqlite3.connect(ci.Database)
>
> conn.close()
>
> conn = dabo.db.dConnection(ci)
>
> app.PreferenceManager = dPref(cxn=conn,
>
> key='MyAppName')
>
> app.BasePrefKey = 'MyAppName'
You don't need to manually connect to the pref database. Just let Dabo create
and
manage it for you. dGrid by default saves the user-set column widths and
restores
those the next time the grid is shown.
Paul
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/[email protected]