User level control (and how about global variables)

Hi all,

I'd like to have an application that could be used by users with different access levels. The app consists of more than 10 panels, each panel has it's own toolbar. Menus and toolbars should be a little different for each access level.
And what's the right way to use some global variables? By those I mean how my sub sub sub panel's dialog should access database or config variables ar the moment i do ir by
wx.GetApp().GetTopWindow().db or wx.GetApp().GetTopWindow().config.GetValue().
In php I'd simply register session variable...

Algirdas Brazas

By using a module.

For example

globals.py

topwindow = None
dbconn = None

In application startup procedure

import globals

globals.topwindow = frame
globals.dbconn = db.connect('...')

NB: This doesn't work

from globals import *

topwindow = frame # globals.topwindows still refers to None
dbconn = db.connect # globals.dbconn still refers to None

ยทยทยท

On Mon, Mar 17, 2008 at 2:25 PM, Algirdas Brazas <lists@digital.ktu.lt> wrote:

And what's the right way to use some global variables? By those I mean how my
sub sub sub panel's dialog should access database or config variables ar the
moment i do ir by
wx.GetApp().GetTopWindow().db or wx.GetApp().GetTopWindow().config.GetValue().
In php I'd simply register session variable...

---
Charles