Re: [gtk-list] Application




Pavel Greenfield <pavel@riskdevel.ml.com> writes:

> Check out the new version of pgpa (gtk-based, glorified gnuplot + a little
> symbolic intelligence). It now has it's own parser.

Very cool! I think this will reduce my use of gnuplot by about 50%

> PS: You will notice that the "Close" button does not work very well. It
> calls gtk_main_quit() which I guess quits gtk_main() but doesn't actually
> get rid of the windows. Also, the next attempt to "do" a certain function
> (which calls gtk_main() after it's been quit()) crashes the application. 
> So , q: what do you do to repeatedly enter and quit the "gui mode".
> q2: The obvious next step is to have the parser work in a widget. Will
> gtk_text_widget be the solution? How's the text widget doing, anyway?

gtk_main_quit() just quits the main loop of the application - so it
shouldn't get rid of the windows. I don't know the next call to
gtk_main() crashes though. However, it's probably better to deal
with parsing in an input handler. The idea is you specify a function
to be called whenever data is available to be read/written on a certain
file handle. In this case, it would be a function that read a line
of text from stdin and parsed it.

gint gdk_input_add    (gint              source,
		       GdkInputCondition condition,
		       GdkInputFunction  function,
		       gpointer          data);
void gdk_input_remove (gint              tag);

typedef void (*GdkInputFunction) (gpointer          data,
				  gint              source,
				  GdkInputCondition condition);

typedef enum
{
  GDK_INPUT_READ       = 1 << 0,
  GDK_INPUT_WRITE      = 1 << 1,
  GDK_INPUT_EXCEPTION  = 1 << 2
} GdkInputCondition;

It is even possible to make the GNU readline library (something
it would be nice if pgpa worked with...) handle input in this
type of callback.

Regards,
                                        Owen



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