How to draw uiview in background thread.

hi all, i have a big map in my iphone application, i need to dynamic load the map when user move the map. in this case, i need to draw the new loaded part before user can see it, my question is how to draw those new loaded part in background thread?
i tried to create a thread, and in this thread call [xxview setNeedsDisplay], but this thread closed before the drawRect is finished.
thanks.

You can also load the VI through the VI Server. Since the data flow is avoided, and the VI is essentially loaded as external code, it gets it's own thread as far as I know.
When doing this, setting the Property "Wait until finished" to false is quite useful too.
Hope this helps.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
Attachments:
Vi server.png ‏16 KB

Similar Messages

  • How to draw Alternative Row Background in TileList?

    HI All,
    I have tried to draw Alternative Row Background by using drawRowBackground().
    But there is not parameter to pass the value.
    How to draw alternative row background in tilelist?

    Does Rado's following blog entry help: http://adf-rk.blogspot.com/2007/01/adf-oracle-form-like-overflow-in-adf.html

  • How do you monitor a background thread and update the GUI

    Hello,
    I have a thread which makes its output available on PipedInputStreams. I should like to have other threads monitor the input streams and update a JTextArea embedded in a JScrollPane using the append() method.
    According to the Swing tutorial, the JTextArea must be updated on the Event Dispatch Thread. When I use SwingUtilities.invokeLater () to run my monitor threads, the component is not redrawn until the thread exits, so you don't see the progression. If I add a paint () method, the output is choppy and the scrollbar doesn't appear until the thread exits.
    Ironically, if I create and start new threads instead of using invokeLater(), I get the desired result.
    What is the correct architecture to accomplish my goal without violating Swing rules?
    Thanks,
    Brad
    Code follows:
    import java.lang.*;
    import java.io.*;
    import javax.swing.*;
    import javax.swing.text.*;
    import java.awt.*;
    import java.awt.event.*;
    public class SystemCommand implements Runnable
         private String[] command;
         private PipedOutputStream pipeout;
         private PipedOutputStream pipeerr;
         public SystemCommand ( String[] cmd )
              command = cmd;
              pipeout = null;
              pipeerr = null;
         public void run ()
              exec ();
         public void exec ()
              // --- Local class to redirect the process input stream to a piped output stream
              class OutputMonitor implements Runnable
                   InputStream is;
                   PipedOutputStream pout;
                   public OutputMonitor ( InputStream i, PipedOutputStream p )
                        is = i;
                        pout = p;
                   public void run ()
                        try
                             int inputChar;
                             for ( ;; )
                                  inputChar = is.read();
                                  if ( inputChar == -1 ) { break; }
                                  if ( pout == null )
                                       System.out.write ( inputChar );
                                  else
                                       pout.write ( inputChar );
                             if ( pout != null )
                                  pout.flush ();
                                  pout.close ();
                             else
                                  System.out.flush();
                        catch ( Exception e ) { e.printStackTrace (); }     
              try
                   Runtime r = Runtime.getRuntime ();
                   Process p = r.exec ( command );
                   OutputMonitor out = new OutputMonitor ( p.getInputStream (), pipeout );
                   OutputMonitor err = new OutputMonitor ( p.getErrorStream (), pipeerr );
                   Thread t1 = new Thread ( out );
                   Thread t2 = new Thread ( err );
                   t1.start ();
                   t2.start ();
                   //p.waitFor ();
              catch ( Exception e ) { e.printStackTrace (); }
         public PipedInputStream getInputStream () throws IOException
              pipeout = new PipedOutputStream ();
              return new PipedInputStream ( pipeout );
         public PipedInputStream getErrorStream () throws IOException
              pipeerr = new PipedOutputStream ();
              return new PipedInputStream ( pipeerr );
         public void execInThread ()
              Thread t = new Thread ( this );
              t.start ();
         public static JPanel getContentPane ( JTextArea ta )
              JPanel p = new JPanel ( new BorderLayout () );
              JPanel bottom = new JPanel ( new FlowLayout () );
              JButton button = new JButton ( "Exit" );
              button.addActionListener ( new ActionListener ( )
                                       public void actionPerformed ( ActionEvent e )
                                            System.exit ( 0 );
              bottom.add ( button );
              p.add ( new JScrollPane ( ta ), BorderLayout.CENTER );
              p.add ( bottom, BorderLayout.SOUTH );
              p.setPreferredSize ( new Dimension ( 640,480 ) );
              return p;
         public static void main ( String[] argv )
              // --- Local class to run on the event dispatch thread to update the Swing GUI
              class GuiUpdate implements Runnable
                   private PipedInputStream pin;
                   private PipedInputStream perr;
                   private JTextArea outputArea;
                   GuiUpdate ( JTextArea textArea, PipedInputStream in )
                        pin = in;
                        outputArea = textArea;
                   public void run ()
                        try
                             // --- Reads whole file before displaying...takes too long
                             //outputArea.read ( new InputStreamReader ( pin ), null );
                             BufferedReader r = new BufferedReader ( new InputStreamReader ( pin ) );
                             String line;
                             for ( ;; )
                                  line = r.readLine ();
                                  if ( line == null ) { break; }
                                  outputArea.append ( line + "\n" );
                                  // outputArea.paint ( outputArea.getGraphics());
                        catch ( Exception e ) { e.printStackTrace (); }
              // --- Create and realize the GUI
              JFrame f = new JFrame ( "Output Capture" );
              f.setDefaultCloseOperation ( JFrame.EXIT_ON_CLOSE );
              JTextArea textOutput = new JTextArea ();
              f.getContentPane().add ( getContentPane ( textOutput ) );
              f.pack();
              f.show ();
              // --- Start the command and capture the output in the scrollable text area
              try
                   // --- Create the command and setup the pipes
                   SystemCommand s = new SystemCommand ( argv );
                   PipedInputStream stdout_pipe = s.getInputStream ();
                   PipedInputStream stderr_pipe = s.getErrorStream ();
                   // --- Launch
                   s.execInThread ( );
                   //s.exec ();
                   // --- Watch the results
                   SwingUtilities.invokeLater ( new GuiUpdate ( textOutput, stdout_pipe ) );
                   SwingUtilities.invokeLater ( new GuiUpdate ( textOutput, stderr_pipe ) );
                   //Thread t1 = new Thread ( new GuiUpdate ( textOutput, stdout_pipe ) );
                   //Thread t2 = new Thread ( new GuiUpdate ( textOutput, stderr_pipe ) );
                   //t1.start ();
                   //t2.start ();
              catch ( Exception e ) { e.printStackTrace (); }
              

    Thanks for pointing out the SwingWorker class. I didn't use it directly, but the documentation gave me some ideas that helped.
    Instead of using invokeLater on the long-running pipe-reader object, I run it on a normal thread and let it consume the output from the background thread that is running the system command. Inside the reader thread I create a tiny Runnable object for each line that is read from the pipe, and queue that object with invokeLater (), then yield() the reader thread.
    Seems like a lot of runnable objects, but it works ok.

  • How to terminate/destroy a user thread running in background?

    Hi All!
    I m using t.destroy() to stop a background running thread, as t.stop() is depricated in Java 2. I implement Runnable in the background thread. On calling t.destroy() NoSuchMethodException; don't know whats the problem there?

    I still don't see any solutions to the issues with performing a Runtime.exec, or stopping a thread from the outside.
    Here's my situation - I have need to make a framework that processes "work" asynchronously. Work is an abstract concept that is realized (an interface is implemented) by other classes. Work comes into the system and is persisted. A seperate mechanism gets the work and processes the work when possible.
    Processing "work" is an abstract concept that is realized (interface is implemented) by other classes.
    All the threading/asynchronous behavoir is in the framework.
    Thus I can't control how work processing occurs within the framework. At certain points I do have to be able to interrupt the work from the outside. Thus the framework threads are busy doing "work" (defined in a class not "known" to the framework) - but the framework has to shutdown.
    So I'm left with thread.stop
    Yes - the framework threads are designed around a volitile "continueProcessing" flag.
    Yes - some of the tasks can perform their work in piecemeal and use this flag.
    No - not all the work can be done in a piecemeal way.
    This whole framework is a solution to situations where multiple high-CPU, high-memory, asynchronous tasks get flooded into the app-server (we don't control the clients - they are outside this business).
    So we persist the request, and have a framework polling for more work. That way even if 10000 requests hit us as the same time (it has happened); we don't get floored.
    We tried sevlet and JMS processing, but those both have back-log limitations. We could poll for work, then send the request to a seperate JMS queue that terminates in a MDB but this exposes an entry point into work processing. And the whole point of this is to control the amount of processing occurring at any given time, without losing any of the requests.

  • How to draw using photoshop?

    Hi
    I am an iphone developer and I need to develop some images for my iphone application. Images like a background with gradient, icons, etc.
    I am absolutely new to drawing and photoshop and was hoping if someone can guide me in the right direction.
    First, is Photoshop the right tool for this kind of stuff? There are so many products and I do not know which one is right for me.
    Can someone give me a link to a book or document where I can learn the basics of drawing using photoshop? Many books that i saw, all talked about working with photographs. But all i am interested in is drawing icons for iPhone applications.
    Thanks
    Anuj

    Anuj, it seems that we cross posted: I posted as you were typing your answer, and you might have missed my post number 3 in this thread.
    http://www.smashingmagazine.com/2008/11/26/iphone-psd-vector-kit/ is another resource of GUI elements.
    There are also commercial products: http://www.iphonedesigntools.com/
    Here are some links on how to design an iPhone app: http://mobileorchard.com/7-iphone-ui-user-interface-design-resources/
    http://www.bamboudesign.com/preso/photoshop/iphoneappdesign_Photoshop_PDF.pdf (before retina display)
    There is how to draw in Photoshop tutorial per se, but many tutorials on how to draw in real life that could be applied in Photoshop.

  • How to Draw 3-D scatter plot in J2ME?

    HI all
    I am new in J2ME And I need to draw a three dimensional scatter plot in J2ME application. Can any body help me how to do so? It's urgent and I am eagerly waiting for your response. Even if you can tell me how to draw a 3-D point like (x,y,z)=(3,5,8) in J2ME?

    I've removed the thread you started in the Java3D forum.
    db

  • How to Draw table in SAPscript ???

    Hi all Guru of SAPScript!
    I want to draw a table with column and row in SAPscript. Who can help me step by step?
    Thanks!
    Edited by: kathy a on May 6, 2008 11:53 AM

    Hi,
    Use BOx Syantax  How to Draw table in SAPscript ??? Pls Read the description
    Syntax:
    1. /: BOX [XPOS] [YPOS] [WIDTH] [HEIGHT] [FRAME] [INTENSITY]
    2. /: POSITION [XORIGIN] [YORIGIN] [WINDOW] [PAGE]
    3. /: SIZE [WIDTH] [HEIGHT] [WINDOW] [PAGE]
    BOX
    Syntax:
    /: BOX [XPOS] [YPOS] [WIDTH] [HEIGHT] [FRAME] [INTENSITY]
    Effect: draws a box of the specified size at the specified position.
    Parameters: For each parameter (XPOS, YPOS, WIDTH, HEIGHT and FRAME), both a measurement and a unit of measure must be specified. The INTENSITY parameter should be entered as a percentage between 0 and 100.
    •XPOS, YPOS: Upper left corner of the box, relative to the values of the POSITION command.
    Default: Values specified in the POSITION command.
    The following calculation is performed internally to determine the absolute output position of a box on the page:
    X(abs) = XORIGIN + XPOS
    Y(abs) = YORIGIN + YPOS
    •WIDTH: Width of the box.
    Default: WIDTH value of the SIZE command.
    •HEIGHT: Height of the box.
    Default: HEIGHT value of the SIZE command.
    •FRAME: Thickness of frame.
    Default: 0 (no frame).
    •INTENSITY: Grayscale of box contents as %.
    Default: 100 (full black)
    Measurements: Decimal numbers must be specified as literal values (like ABAP/4 numeric constants) by being enclosed in inverted commas. The period should be used as the decimal point character. See also the examples listed below.
    Units of measure: The following units of measure may be used:
    •TW (twip)
    •PT (point)
    •IN (inch)
    •MM (millimeter)
    •CM (centimeter)
    •LN (line)
    •CH (character).
    The following conversion factors apply:
    •1 TW = 1/20 PT
    •1 PT = 1/72 IN
    •1 IN = 2.54 CM
    •1 CM = 10 MM
    •1 CH = height of a character relative to the CPI specification in the layout set header
    •1 LN = height of a line relative to the LPI specification in the layout set header
    Examples:
    /: BOX FRAME 10 TW
    Draws a frame around the current window with a frame thickness of 10 TW (= 0.5 PT).
    /: BOX INTENSITY 10
    Fills the window background with shadowing having a gray scale of 10 %.
    /: BOX HEIGHT 0 TW FRAME 10 TW
    Draws a horizontal line across the complete top edge of the window.
    /: BOX WIDTH 0 TW FRAME 10 TW
    Draws a vertical line along the complete height of the left hand edge of the window.
    /: BOX WIDTH '17.5' CM HEIGHT 1 CM FRAME 10 TW INTENSITY 15
    /: BOX WIDTH '17.5' CM HEIGHT '13.5' CM FRAME 10 TW
    /: BOX XPOS '10.0' CM WIDTH 0 TW HEIGHT '13.5' CM FRAME 10 TW
    /: BOX XPOS '13.5' CM WIDTH 0 TW HEIGHT '13.5' CM FRAME 10 TW
    Draws two rectangles and two lines to construct a table of three columns with a highlighted heading section.
    POSITION
    Syntax:
    /: POSITION [XORIGIN] [YORIGIN] [WINDOW] [PAGE]
    Effect: Sets the origin for the coordinate system used by the XPOS and YPOS parameters of the BOX command. When a window is first started the POSITION value is set to refer to the upper left corner of the window (default setting).
    Parameters: If a parameter value does not have a leading sign, then its value is interpreted as an absolute value, in other words as a value which specifies an offset from the upper left corner of the output page. If a parameter value is specified with a leading sign, then the new value of the parameter is calculated relative to the old value. If one of the parameter specifications is missing, then no change is made to this parameter.
    •XORIGIN, YORIGIN: Origin of the coordinate system.
    •WINDOW: Sets the values for the left and upper edges to be the same of those of the current window (default setting).
    •PAGE: Sets the values for the left and upper edges to be the same as those of the current output page (XORIGIN = 0 cm, YORIGIN = 0 cm).
    Examples:
    /: POSITION WINDOW
    Sets the origin for the coordinate system to the upper left corner of the window.
    /: POSITION XORIGIN 2 CM YORIGIN '2.5 CM'
    Sets the origin for the coordinate system to a point 2 cm from the left edge and 2.5 cm from the upper edge of the output page.
    /: POSITION XORIGIN '-1.5' CM YORIGIN -1 CM
    Shifts the origin for the coordinates 1.5 cm to the left and 1 cm up.
    SIZE
    Syntax:
    /: SIZE [WIDTH] [HEIGHT] [WINDOW] [PAGE]
    Effect: Sets the values of the WIDTH and HEIGHT parameters used in the BOX command. When a window is first started the SIZE value is set to the same values as the window itself (default setting).
    Parameters: If one of the parameter specifications is missing, then no change is made to the current value of this parameter. If a parameter value does not have a leading sign, then its value is interpreted as an absolute value. If a parameter value is specified with a leading sign, then the new value of the parameter is calculated relative to the old value.
    •WIDTH, HEIGHT: Dimensions of the rectangle or line.
    •WINDOW: Sets the values for the width and height to the values of the current window (default setting).
    •PAGE: Sets the values for the width and height to the values of the current output page.
    Examples:
    /: SIZE WINDOW
    Sets WIDTH and HEIGHT to the current window dimensions.
    /: SIZE WIDTH '3.5' CM HEIGHT '7.6' CM
    Sets WIDTH to 3.5 cm and HEIGHT to 7.6 cm.
    /: POSITION WINDOW
    /: POSITION XORIGIN -20 TW YORIGIN -20 TW
    /: SIZE WIDTH +40 TW HEIGHT +40 TW
    /: BOX FRAME 10 TW
    A frame is added to the current window. The edges of the frame extend beyond the edges of the window itself, so as to avoid obscuring the leading and trailing text characters.
    Reward Helpfull Answers
    Regards
    Fareedas

  • How do I add a background picture til my swing CUI

    How do I add a background picture til my CUI. I�m using Swing - not using any JPanel.
    Here my code:
    class Start extends JFrame implements ActionListener
         JButton soeg, tilfoj, afslut;
         JTextField beskedText;
         JLabel besked;
         private Image baggrund;
         public Start()
              setTitle("Video Registrerings System");
              setSize(300,250);
              setVisible(true);
              addWindowListener(new WindowAdapter()               // Opretter vinues "lytter"
                   public void windowClosing(WindowEvent e)
                        System.exit(0);
              Container c;
              c = getContentPane();
              c.setLayout(null);
              try
                   URL imagename = new URL("file:/c:/jdk1.3.1_02/java/vrs_background.jpg");
                   baggrund = createImage((ImageProducer) imagename.getContent());
              catch (Exception e) {}
              // Tilf�jer knapperne
              tilfoj = new JButton("Tilf�j ny video");
              tilfoj.setBounds(75,110,150,25);
              tilfoj.setVisible(true);
              tilfoj.addActionListener(this);
              c.add(tilfoj);
              soeg = new JButton("Video s�gning");
              soeg.setBounds(75,145,150,25);
              soeg.setVisible(true);
              soeg.addActionListener(this);
              c.add(soeg);
              afslut = new JButton("Afslut");
              afslut.setBounds(75,180,150,25);
              afslut.setVisible(true);
              afslut.addActionListener(this);
              c.add(afslut);
              //Tilf�jer tekstfelt og label
              besked = new JLabel("Besked:");
              besked.setBounds(10,45,50,25);
              besked.setVisible(true);
              c.add(besked);
              beskedText = new JTextField(" V�lg en af de nedenst�ende knapper");
              beskedText.setBounds(65,45,215,25);
              beskedText.setVisible(true);
              c.add(beskedText);
         }

    Here is a link that might help you:
    http://forum.java.sun.com/thread.jsp?forum=57&thread=219443

  • Last question for today - how to draw with API circle of N pixels radius

    Hi,
    While I'm bit of exhausted while fighting with those paths movement (see my other thread in this forum) - I'd like to ask maybe someone has code snippet, which shows how to draw a circle of N pixels/N mm/inches radius?
    There is one helper function for that inside SDK samples:
    PDEPath DrawCurve(ASFixed x, ASFixed y, ASFixed x1, ASFixed y1, ASFixed x2, ASFixed y2, ASFixed x3, ASFixed y3, int lineWidth, int r, int g, int b)
    but I'm just out of my mind for today what parameters should be provided and how many calls of it I should write.
    Any help would be appreciated.

    You call it four times...
    Here is a snippet that explains the math...
    /* 4/3 * (1-cos 45)/sin 45 = 4/3 * sqrt(2) - 1 */
    #define ARC_MAGIC ((ASFixed) 0.552284749)
    #define PI ((ASFixed)3.141592654)
    void DrawCircle( ASFixed inCenterX, ASFixed inCenterY, ASFixed inRadius )
    /* draw four Bezier curves to approximate a circle */
    MoveTo( inCenterX + inRadius, inCenterY );
    CurveTo( inCenterX + inRadius, inCenterY + inRadius*ARC_MAGIC,
    inCenterX + inRadius*ARC_MAGIC, inCenterY + inRadius,
    inCenterX, inCenterY + inRadius );
    CurveTo( inCenterX - inRadius*ARC_MAGIC, inCenterY + inRadius,
    inCenterX - inRadius, inCenterY + inRadius*ARC_MAGIC,
    inCenterX - inRadius, inCenterY );
    CurveTo( inCenterX - inRadius, inCenterY - inRadius*ARC_MAGIC,
    inCenterX - inRadius*ARC_MAGIC, inCenterY - inRadius,
    inCenterX, inCenterY - inRadius );
    CurveTo( inCenterX + inRadius*ARC_MAGIC, inCenterY - inRadius,
    inCenterX + inRadius, inCenterY - inRadius*ARC_MAGIC,
    inCenterX + inRadius, inCenterY );
    Close();

  • How to draw a perfect circle and how to make sure it is perfectly centered inside a square

    How to draw a perfect circle and how to make sure it is perfectly centered inside a square in Photoshop elements using the Ellipse option.

    1. Create a square canvas.
    2. With the Elipse tool, hold down Shift (Shift forces a circle). Draw the circle anywhere on the canvas (Shape 1 in this example).
    3. Simplify the circle layer
    4. Ctrl-click the layer to select the circle.
    5. Copy the selection to the clipboard (Edit > Copy).
    6. Deselect the selection.
    7. Paste from the clipboard (Edit > Paste). The pasted circle (Layer 1) will be centered.
    8. Delete the original circle layer.
    NOTE: Step 6 is the key. This guarantees that the pasted circle will be centered.
    If you want a circle completely within a square you can simply draw and simplify a circle on any shape canvas. Ctlrl-click the circle to to select it and copy to the clipboard.
    Then do File > New from Clipboard. This creates the circle cropped to a square on transparent background.

  • How to draw and modify double lines with Adobe Illustrator?

    I need tot draw roadmaps. This should be easy using the pen tool, but my problem is that I cannot find a way to draw double lines with this tool. I have seen many fancy border styles and patterns. Some do have double or even quadruple lines, but the problem is than that they have an offset from the vector line and the space in between the two lines (the edges of the road) cannot be filled. Somewere I also found some pens called 'Double line 1.1' to 'Double line 1.6' but they also had an offset from the vector and I could not chance the size of the lines and the interval in between them independently.
    What I am looking for is a way to draw two lines in parallel and have the option tot fill the space in between with a color or even a pattern.
    The color and size of the lines should be changeable to make a distinction between several types of road.
    Is there an existing set of pencils for this purpose? It would be nice to be able to draw not only roads, but also railways and rivers!
    I am surely not the first person who needs to do this?
    I use AI version 6

    Jacob,
    Thanks for the answer. I have been searching for a solutions for a long
    time, but today I found the solution on a forum (not on this one). That
    solution is exactly as you described below, i.e. using a coloured line and a
    narrower white line on top of the first one. My problem was that I did not
    know how to create a custom brush based on the two lines. Now I know how to
    do that. However, I still have the problem. I can now draw double lines and
    I can change the color of the background line (the coloured one) but I
    cannot change the white colour of the narrower line. I assume that I have to
    completely redefine a new brush when I need to change that colour too.
    Regards,
    Rob Kole
    Van: Jacob Bugge [email protected]
    Verzonden: donderdag 28 maart 2013 17:04
    Aan: RKOLE
    Onderwerp: How to draw and modify double lines with Adobe
    Illustrator?
    Re: How to draw and modify double lines with Adobe Illustrator?
    created by Jacob Bugge <http://forums.adobe.com/people/Jacob+Bugge>  in
    Illustrator - View the full discussion
    <http://forums.adobe.com/message/5186535#5186535

  • Update listview from a background thread

    my thread listens to the mails coming to outlook. i have a list in javafx stage which displays the inbox of my outlook. when i get a new mail it should appear in my listview also how to do that. pls help.

    Updating a control that is currently visible must always be done from the JavaFX event thread. So, updating a control directly from a background thread will not work.
    Hiowever, there is a function in the Platform class, Platform.runLater(), that allows you to submit a Runnable that will be executed on the JavaFX event thread as soon as possible. From this Runnable you can update your controls.
    Platform.runLater(new Runnable() {
      public void run() {
        // do your updates here (no big calculatiions though as that would block the FX thread resulting in an unresponsive UI).
    });

  • How Do I Delete/Crop Background?

    I have a video from a game console with a static image (a HUD for you gamers.) Everything stays still in the HUD except for the "radar" which sends out waves like a submarine's SONAR. I really would like to put this HUD on top of a video, but I need to crop out the background first. I know that I can just put a still frame of this HUD over the video, but the radar adds so much, so I really want it in the video. I assumed that FCE would have a feature like this, but I couldn't find it. I was wondering if anyone knows how to crop out the background in FCE. There might be no way, but as you can probably see, I'm a FCE noob, so I might be wrong. Thanks!

    Try using one of the Garbage Matte effects. You will basically draw a shape around the part of the image you want to keep, thereby excluding what you don't want.

  • Python, GTK and background threads

    OK, I'm still new to python (but my teeth on COBOL a long long time ago), and whilst I can usually battle through existing scripts and figure out what's going on, I'm trying to add functionality to one of my own and no idea how to do it.
    I have a python script that launches an external process (os.popen) and then opens a gtk window. The gtk works just fine and does what it's supposed to. However, I want to add a thread that will check whether or now the external program is running and if it's finished, automatically destroy the gtk window and exit the script. However, to get the gtk window I obviously have to call gtk.main, which prevents me from launching my own loop testing the other program.
    incidentally, my test is based on
    child = os.popen("ExternalProgram")
    if child.poll() == None:
    And I'm not even sure that's the correct way to test (haven't been able to even start testing yet) so perhaps if someone could give me a heads up on that, too
    Any idea?
    TIA

    Here I am
    "os.popen" and related functions have been superseded by the "subprocess" module. Use "subprocess.Popen" to spawn processes.
    Wrap the invocation of the background task in a separate class – let's call it "BackgroundWorker" for now – that spawns a background thread which in turn executes the process via "subprocess.call()" and emits a "finished" signal when the process terminated. Create an instance of this class in In "MyWindow.__init__()" (where "MyWindow" is derived from "Gtk.Window") and connect the "BackgroundWorker.finished" signal to a callback which closes the window. In the entry point of your script create an instance of "MyWindow", show it and start the Gtk main loop.
    Before that, read the documentation of Gtk and look for a class that wraps background processes, like "QProcess" does in Qt. I don't know if such a class exists in Gtk but if it does it'll significantly ease working with subprocesses in a GUI.
    Last but not least a general and very important note concerning threads and GUIs: Do never access any GUI element directly from background thread!
    Last edited by lunar (2012-05-26 17:11:25)

  • How can I change the background of a running webpage on my own. Example Facebook I want to change its backround color from white to black just in my view not for all

    How can I change the background of a running webpage on my own. Example Facebook I want to change its background color from white to black just in my view, not for all. Cause I really hate some site with white background because as I read for an hour it aches my eyes but not on those with darker background color.

    You can use the NoSquint extension to set font sizes (text/page zoom) and text colors on web pages.
    *NoSquint: https://addons.mozilla.org/firefox/addon/nosquint/

Maybe you are looking for

  • ICal not publishing to MobileMe

    Simple problem: Trying to publish my home calendars to MoblieMe. When I select a calendar from ON MY MAC, then select CHANGE LOCATION and choose PUBLISH ON MOBILEME, then hit PUBLISH ... it says the calendar has been published. But when I choose VISI

  • Adobe PDF plugin 10.1.5.33 does not print correctly. Some text comes out all garbled but looks fine on screen.

    I am using Adobe PDF plugin 10.1.5.33. I can open PDF files and they look fine. When I print some of the test comes out all garbled - usually labels, notes at bottom etc. If I disable plugin then when I open PDF Firefox uses Adobe PDF reader to open

  • Hash join end bind join

    Hi I would like to know if there is difference between bind join end hash join. For example If I write sql code in My query tool (in Data Federator Query server administrator XI 3.0) it is traduced in a hashjoin(....);If I set system parameters in ri

  • How do I rearrange toolbars in firefox 4?

    How do I rearrange toolbars in firefox 4? My yahoo toolbar stays at the top and I can't move it down. Thanks

  • File conversion for DVD

    Hi:) I'm trying to export a 3 minute and 25 second edited video to burn to DVD. The video was recorded on a Canon HV20 (consumer HD) and on HD DV tapes, when I make a Quicktime movie the quality looks great but when try to burn that on to DVD using i