[Pygui] Windows not being refreshed

2012-03-24 Thread jka...@juno.com
Hello - I've enjoyed using the framework so far, but have run in to a 
frustration with my window not being redrawn.   From a basic framework 
perspective, here's how I have things set up. class My_Window( Window )def 
__init__(self, **kwds):
  Window.__init__(self, **kwds)   self._main_frame = Frame( #frame 
attributes )  self._sub_frame = None  self.place( _main_frame )def 
set_sub_frame( self, sub_frame ):  if None <> self._sub_frame: 
self._main_frame.remove( self._sub_frame )  self._main_frame.place( 
sub_frame )  self._sub_frame = sub_frame #end My_Window class class My_App( 
Application )   def __init___( self ):  Application.__init__(self)def 
open_app( self ):  self._main_window = My_Window( #window attributes )  
 # I create other buttons and things on the GUI that will activate  # 
actions in this main application   self._main_window.show() def 
button_is_pressed( self ):   new_frame = Frame( # frame attributes )   
self._main_window.set_sub_frame( new_frame ) #end My_App class my_app = My_App( 
) my_app.run( ) #end code When I give a new sub frame (or any other GUI object) 
in to the main frame, all of the text of both objects are drawn in the main 
window. If I hide the window and bring it back to the front, it'll be re-drawn, 
but I can't seem to find where to do that programmatically. Is there something 
that I'm missing in setting up the application/window? This is really basic 
code that shows the main points (or at least what I believe to be the main 
points for interacting with PyGUI).  Please let me know if there's more 
clarification needed.  Thanks for your time. jason  

The New "Skinny" Fruit
How This Strange 62-Cent African Fruit Is Making Americans Skinny.
http://thirdpartyoffers.juno.com/TGL3131/4f6decbd5129a2ea95b5st05duc___
Pygui mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pygui


Re: [Pygui] Windows not being refreshed

2012-03-26 Thread jka...@juno.com
Greg -  Thanks for the response. Initially, I had everything subclassed (MyApp( 
Application ) creating MyWindow( Window ) containing a provided Frame 
containing a MyFrame( Frame ) containing a provided Grid. As an experiment, I 
changed things so that each class just creates one of the built-in object and 
provides a method for retrieving the built in Window/Frame. I left MyApp as a 
subclass of Application so that I would still have someone able to handle 
button events. However, I'm still seeing the same behavior when I scroll 
through the list, namely, not having anything removed from the display when 
something new is supposed to be drawn on it. I feel as though I'm completely 
missing something fundamental. With this sort of setup, when I click to scroll 
down, am I expected to have an overridden method that will be invoked? At what 
level will one of my object be called first? What am I expected to do with that 
call? I've tried creating a draw method (that is invoked when I try to scroll), 
but I'm at a bit of a loss as to what I'm supposed to do with the provided 
canvas and rectangle.  Any help or pointing to the pertinent documentation is 
appreciated. Thanks in advance. jason

-- Original Message --
From: Greg Ewing 
To: "[email protected]" 
Cc: [email protected]
Subject: Re: [Pygui] Windows not being refreshed
Date: Sun, 25 Mar 2012 16:56:59 +1300

[email protected] wrote:

> When I give a new sub frame (or any other GUI object) in to the main 
> frame, all of the text of both objects are drawn in the main window. If 
> I hide the window and bring it back to the front, it'll be re-drawn, but 
> I can't seem to find where to do that programmatically. Is there 
> something that I'm missing in setting up the application/window?

Are you talking about user-defined views (derived from View) or
built-in components (buttons, labels, text fields, etc)?

To refresh a user-defined view, you call its invalidate() or
invalidate_rect() method. You shouldn't need to explicitly tell
built-in objects to refresh, they should do it themselves
automatically whenever needed.

Do you have something that isn't refreshing when you think it
should? Can you post a complete example?

-- 
Greg

53 Year Old Mom Looks 33
The Stunning Results of Her Wrinkle Trick Has Botox Doctors Worried
http://thirdpartyoffers.juno.com/TGL3131/4f7154841dc2a2fcfcecst06duc___
Pygui mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pygui