swarm-support
[Top][All Lists]
Advanced

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

Re: GUISwarm and gtk ?


From: Marcus G. Daniels
Subject: Re: GUISwarm and gtk ?
Date: 31 Jul 2001 10:33:19 -0600
User-agent: Gnus/5.070084 (Pterodactyl Gnus v0.84) Emacs/20.7

>>>>> "DK" == Daniel Kottow <address@hidden> writes:

DK> while (gtk_events_pending()) gtk_main_iteration();

DK> when i hit stop, gtk windows dont react, however.  its ok with me
DK> that gtk gets little attention, but i would like to have this
DK> display schedule running in the back with low priority always,
DK> regardless of my simulation status.  this seems more like a pure
DK> swarm question, isnt it? 

One nice thing about Objective C is that you never have to accept "no"
as an answer -- here's a little old-school anarchy to get the job done.  ;-)

  1) Add the alternative ControlPanel below, replacing the printf
     with the GTK update code.  Add MyControlPanel.o to the OBJECTS in 
     your Makefile.

  2) Use +poseAs: before creating the GUISwarm in order to make
     this implementation look like the real ControlPanel.

  3) Call your GTK update code along with the doTkEvents code.

(Yes, the ControlPanel code should be rewritten.)

$ cat MyControlPanel.h
#import <simtoolsgui.h>
#import <simtoolsgui/ControlPanel.h>

@interface MyControlPanel : ControlPanel
- setStateStopped;
@end


$ cat MyControlPanel.m
#import "MyControlPanel.h"
#import <simtoolsgui.h>
#import <gui.h>

@implementation MyControlPanel

- setStateStopped
{
  [probeDisplayManager setDropImmediatelyFlag: YES];
  if (_activity_current)
    {
      [getTopLevelActivity() stop];
      return [self setState: ControlStateStopped];
    }
  else
    {
      [self setState: ControlStateStopped];
      while (state == ControlStateStopped)
        {
          printf ("sync\n");
          GUI_EVENT_SYNC ();
        }
      return self;
    }
}
@end

                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.




reply via email to

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