commit-gnue
[Top][All Lists]
Advanced

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

gnue-forms/src/uidrivers/gtk2 __init__.py UIdri...


From: Jan Ischebeck
Subject: gnue-forms/src/uidrivers/gtk2 __init__.py UIdri...
Date: Mon, 04 Aug 2003 11:37:31 -0400

CVSROOT:        /cvsroot/gnue
Module name:    gnue-forms
Branch:         
Changes by:     Jan Ischebeck <address@hidden>  03/08/04 11:37:31

Modified files:
        src/uidrivers/gtk2: __init__.py UIdriver.py 
Added files:
        src/uidrivers/gtk2: GFApp.py 

Log message:
        move mainloop code from gtk2 UIdriver into seperate application class 
(GFApp)

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-forms/src/uidrivers/gtk2/GFApp.py?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-forms/src/uidrivers/gtk2/__init__.py.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-forms/src/uidrivers/gtk2/UIdriver.py.diff?tr1=1.25&tr2=1.26&r1=text&r2=text

Patches:
Index: gnue-forms/src/uidrivers/gtk2/UIdriver.py
diff -c gnue-forms/src/uidrivers/gtk2/UIdriver.py:1.25 
gnue-forms/src/uidrivers/gtk2/UIdriver.py:1.26
*** gnue-forms/src/uidrivers/gtk2/UIdriver.py:1.25      Mon May 19 20:06:35 2003
--- gnue-forms/src/uidrivers/gtk2/UIdriver.py   Mon Aug  4 11:37:30 2003
***************
*** 35,42 ****
  import gtk
  import pango
  
- __gtk_mainloop = None
- 
  ## check if we really imported gtk 2.0
  if not hasattr(gtk,"keysyms"):
    print _("Import error: You need pygtk 2.0 to use the gtk2 user" +\
--- 35,40 ----
***************
*** 55,61 ****
  
  from gnue.forms.uidrivers._commonGuiToolkit import UIdriver as commonToolkit
  
! #from gnue.forms.uidrivers.gtk2.GFApp import *
  from gnue.forms.uidrivers.gtk2.SplashScreen import *
  from gnue.forms.uidrivers.gtk2.widgets._base  import *
  from gnue.forms.uidrivers.gtk2.common import PANGO_SCALE
--- 53,59 ----
  
  from gnue.forms.uidrivers._commonGuiToolkit import UIdriver as commonToolkit
  
! from gnue.forms.uidrivers.gtk2.GFApp import *
  from gnue.forms.uidrivers.gtk2.SplashScreen import *
  from gnue.forms.uidrivers.gtk2.widgets._base  import *
  from gnue.forms.uidrivers.gtk2.common import PANGO_SCALE
***************
*** 82,87 ****
--- 80,87 ----
      # GTK Specifics
      ################################################################
  
+     self.app = getApp()
+     
      #
      # SplashScreen
      #
***************
*** 155,161 ****
      if exitApp:
        for child in self._children:
          child.mainWindow.destroy()
!       gtk.main_quit()
  
    def _beep(self):
      pass
--- 155,161 ----
      if exitApp:
        for child in self._children:
          child.mainWindow.destroy()
!       self.app.quit()
  
    def _beep(self):
      pass
***************
*** 171,188 ****
    # mainLoop
    #
    # The primary loop of the user interface.  Called once the UI is
!   # fully activated
    #
    def mainLoop(self):
!     global __gtk_mainloop
!     
!     try:
!       if __gtk_mainloop==None:
!         __gtk_mainloop= 1
!         gtk.main()
!     except:
!       __gtk_mainloop = 1
!       gtk.main()
  
  
    #
--- 171,180 ----
    # mainLoop
    #
    # The primary loop of the user interface.  Called once the UI is
!   # fully activated (multiple loops are simulated by GFApp)
    #
    def mainLoop(self):
!     self.app.mainLoop()
  
  
    #
***************
*** 192,202 ****
    # a line of text
    #
    def formAlert(self, event):
!     #wxBell()
!     #ui = self._gfObjToUIWidget[event._form]
!     #ui.statusBar.SetStatusText(event.data,0)
!     
self.statusBar1.push(self.statusBar1.get_context_id("tip"),str(event.data))
! 
  
    #
    # Called whenever forms goes into a "wait" state in which user cannot
--- 184,191 ----
    # a line of text
    #
    def formAlert(self, event):
!     ui = self._gfObjToUIWidget[event._form]
!     
ui.statusBar1.push(ui.statusBar1.get_context_id("tip"),unicode(event.data))
  
    #
    # Called whenever forms goes into a "wait" state in which user cannot
***************
*** 255,280 ****
  
      else:
        GDebug.printMesg(5,'Unable to open clipboard for write')
- 
- 
-   
#############################################################################
-   #
-   # Internal Event Processors
-   #
-   # Processes the events from the widget set
-   #
- 
- 
- 
-   #
-   # closeTrap
-   #
-   # intercepts the applications closure and generates an event to the form 
requesting
-   # closure.  Allows the form to control closure.  If the form approves it'll 
send
-   # back an event closing the application
-   #`
-   def closeTrap(self,event):
-     if event.CanVeto():
-       self.dispatchEvent('requestEXIT',_form=self._form)
-     else:
-       event.object.Destroy()
--- 244,246 ----
Index: gnue-forms/src/uidrivers/gtk2/__init__.py
diff -c gnue-forms/src/uidrivers/gtk2/__init__.py:1.2 
gnue-forms/src/uidrivers/gtk2/__init__.py:1.3
*** gnue-forms/src/uidrivers/gtk2/__init__.py:1.2       Sat May 17 10:46:04 2003
--- gnue-forms/src/uidrivers/gtk2/__init__.py   Mon Aug  4 11:37:30 2003
***************
*** 1,3 ****
--- 1,4 ----
  from UIdriver import GFUserInterface
  from UILoginHandler import *
  from ErrorHandler import handleStartupError, handleUncaughtException
+ from GFApp import getApp




reply via email to

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