gnumed-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnumed-devel] ui update on tab switching


From: Karsten Hilbert
Subject: Re: [Gnumed-devel] ui update on tab switching
Date: Sat, 18 Jul 2009 15:22:26 +0200
User-agent: Mutt/1.5.18 (2008-05-17)

On Sat, Jul 18, 2009 at 02:51:57PM +0200, Hilbert, Sebastian wrote:

> > Do you want it to refresh whenever you tab into the plugin
> > or whenever there is a change to the data in the backend
> > (and the plugin is visible) ?
> 
> In its first iteration I need refreshing when I tab into the plugin, meaning 
> when I selcect the plugin.

Anything that is intended to be used as a notebook plugin is
supposed to derive from

        client/wxpython/gmPlugin.py::cNotebookPlugin

That class makes sure (among other things) that

- on load plugins are registered with the menu system

- provides a default can_receive_focus() method
        - many plugins use that to check whether there is an active patient

- provides a default receive_focus() method
        - calls self._widget.repopulate_ui() if that exists

The methods can_receive_focus() and - if so -
receive_focus() are called on the plugin by the notebook
when that plugin is activated.

So, in effect, you'd want to override .repopulate_ui() in
your widget and do whatever is needed there.

Karsten
-- 
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346




reply via email to

[Prev in Thread] Current Thread [Next in Thread]