in reply to TK - Updating Main Window after user input

Further update ... I got the detele working but not as efficiently as I'd like. To do so, the MainWindow is created using a grid, the grid containing the frame I'd like updated I destroy and then recreate it.

There must be a better way of just removing the required object rather than destroying the whole frame! Ideas anyone?

Dean
  • Comment on Re: TK - Updating Main Window after user input

Replies are listed 'Best First'.
Re: Re: TK - Updating Main Window after user input
by graff (Chancellor) on Jan 08, 2004 at 03:53 UTC
    If I understand you, you're talking about controlling the number of RadioButton widgets present/visible on the GUI, according to the number of entries in a database, and changing the number of buttons at run-time, according to database entries being deleted or created by the user.

    This is the sort of thing I would tend to put in a drop-down or pop-up menu, or in a listbox (where setting "selectMode" to "single" has the effect of making the listbox items behave like radio buttons). It's relatively easy to add or remove elements from a menu, and the pop-up or drop-down behavior means that changes in the set of buttons can go on "behind the scenes". It's really easy to add or remove items from a listbox, which has the added advantage of providing a simple scrolling mechanism (see Tk::Scrolled). Either a pull-down menu or a listbox would be a lot more effecient than re-running the geometry manager on one or more frames to add and remove whole widgets -- and could even seem more sensible from the user's perspective. Is there some compelling reason to be adding and destroying radio buttons in the main window while the user is watching?

      Thanks. I'd considered this option, and considering the expense of destroying the entire window I think I might opt for a listbox or drop menu type widget. The only thing in my favour is its an update that will rarely happen (only after admin changes).

      Dean