CVS: anygui/lib/anygui/backends javagui.py,1.54,1.55

Samuele Pedroni <[email protected]> Sun, 01 Sep 2002 15:57:56 -0700
Newsgroups gmane.comp.python.anygui.cvs
Message-ID <[email protected]>
Update of /cvsroot/anygui/anygui/lib/anygui/backends
In directory usw-pr-cvs1:/tmp/cvs-serv19806

Modified Files:
	javagui.py 
Log Message:
Improved resizing and frame creation.


Index: javagui.py
===================================================================
RCS file: /cvsroot/anygui/anygui/lib/anygui/backends/javagui.py,v
retrieving revision 1.54
retrieving revision 1.55
diff -C2 -r1.54 -r1.55
*** javagui.py	1 Sep 2002 01:27:18 -0000	1.54
--- javagui.py	1 Sep 2002 22:57:53 -0000	1.55
***************
*** 27,31 ****
  from javax import swing
  from java import awt
! import cgi, jarray, java
  
  # Set the "look-and-feel":
--- 27,33 ----
  from javax import swing
  from java import awt
! import java
! #from synchronize import apply_synchronized
! 
  
  # Set the "look-and-feel":
***************
*** 117,120 ****
--- 119,123 ----
              # FIXME: Handle Application containers differently...
              self.create()
+             self.proxy.push(blocked=['container'])
              return
          try:
***************
*** 141,147 ****
              except AttributeError: pass
              else:
!                 bounds = self.widget.bounds
!                 container.remove(self.widget)
!                 container.repaint(bounds)
              try: self.widget.dispose()
              except AttributeError: pass
--- 144,151 ----
              except AttributeError: pass
              else:
!                 if container:
!                     bounds = self.widget.bounds
!                     container.remove(self.widget)
!                     container.repaint(bounds)
              try: self.widget.dispose()
              except AttributeError: pass
***************
*** 394,397 ****
--- 398,409 ----
              ComponentWrapper.setGeometry(self, x, y, width, height)
  
+     def getGeometry(self):
+         bounds = self.widget.bounds
+         x, y, width, height = bounds.x ,bounds.y, bounds.width, bounds.height
+         insets = self.widget.insets
+         width -= insets.left + insets.right
+         height -= insets.top + insets.bottom
+         return x, y, width, height
+ 
      def widgetSetUp(self):
          self.widget.windowClosing = self.closeHandler
***************
*** 412,416 ****
          dw = w - self.proxy.state['width'] # @@@ Avoid invoking pull()...
          dh = h - self.proxy.state['height'] # @@@ Avoid invoking pull()...
!         self.proxy.resized(dw, dh)
  
      def closeHandler(self, evt):
--- 424,433 ----
          dw = w - self.proxy.state['width'] # @@@ Avoid invoking pull()...
          dh = h - self.proxy.state['height'] # @@@ Avoid invoking pull()...
! 
!         #ensure proxy state is updated
!         self.proxy.height
!         self.proxy.width
! 
!         self.proxy.resized(dw,dh)
  
      def closeHandler(self, evt):



-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone?  Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390