Preventing Window Refresh

View: New views
2 Messages — Rating Filter:   Alert me  

Preventing Window Refresh

by Damien Moore-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

In a gui application I'm developing, I have a button that when pressed hides several parts of the gui and displays a fullscreen view of the remaining window

The relevant code is along the lines of:

def clicked_signal(self,button_widget):
  self.widget1.hide()
  self.widget2.hide()
  self.widget3.hide()
  self.widget4.hide()
 ...
  self.window.fullscreen()

widget1,..., widget4 are inside various hboxes nested in the main window

This works but looks terrible as the window seems to refresh after each widget gets hidden. what I want to know is if there is a way to block recalculation and refresh of the window during each of these intermediate steps? e.g. something like:

def clicked_signal(self,button_widget):
  self.freeze()
  self.widget1.hide()
  self.widget2.hide()
  self.widget3.hide()
  self.widget4.hide()
  self.window.fullscreen()
  self.thaw()

hopefully this makes sense? Alternatively, maybe there's a better way to hide the gui elements?


_______________________________________________
pygtk mailing list   pygtk@...
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

Parent Message unknown Re: Preventing Window Refresh

by Damien Moore-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Unfortunately, wrapping the sequence with window hide/show doesn't help.

I spent a little time tracing my code. After my sequence of calls:

def clicked_signal(self,button_
widget):
  self.widget1.hide()
  self.widget2.hide()
  self.widget3.hide()
  self.widget4.hide()
 ...
  self.window.fullscreen()

the following happens

1. the requested widgets get hidden,
2. a configure event gets sent telling my widgets to use the full extent of the window
3. the window goes full screen
4. another configure event occurs telling my widgets to use the full screen.

This sequence seems to happen irrespective of what order I make the hide/fullscreen calls (i.e. if I make the fullscreen call first, the hide events seem to occur before the fullscreen event)

I need some mechanism to prevent the first configure (at step 2) from happening or ignoring it because it looks really ugly....



On Fri, Jul 3, 2009 at 11:06 AM, Alessandro Dentella <sandro@...> wrote:
> This works but looks terrible as the window seems to refresh after each widget
> gets hidden. what I want to know is if there is a way to block recalculation
> and refresh of the window during each of these intermediate steps? e.g.
> something like:

What if you do:

 window.hide()
 hbox1.hide()
 hbox2.hide()
 ...
 hboxn.hide()
 window.fullsize()
 window.show()

would it be better or worse?

*:-)

--
Sandro Dentella  *:-)
http://sqlkit.argolinux.org        SQLkit home page - PyGTK/python/sqlalchemy


_______________________________________________
pygtk mailing list   pygtk@...
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/