From octave-graphics-request at bevo dot che dot wisc dot edu Fri Mar 12 03:07:57 1999 Subject: some action From: "John W. Eaton" To: octave-graphics at bevo dot che dot wisc dot edu Date: Fri, 12 Mar 1999 03:05:43 -0600 OK, here is an idea for some action. While we are deciding what heavy-duty toolkit(s) to use, I think it would be useful to come up with some simple proof-of-concept code based on a brain-dead simple toolkit. So, over the next few days, I'm going to try to work on integrating a few GUI objects into the 2.1.x sources. I'll be using libsx, which is a really simple toolkit based on the Athena widgets. I'm pretty sure there is no fancy web page for it. There is no team of developers. It's not pretty and it doesn't do everything under the sun, but it is small, easy to use, and stable. You can find it at ftp://ftp.x.org/contrib/libraries/libsx.tar.Z. Here's what I'm going to try to do: * Define a new octave_value data type for gui objects. * Define a few functions like gui_button, gui_draw_area, gui_scrollbar, etc. They will look something like this: DEFUN (gui_button, args, , "gui_button (label, callback)") { octave_value retval; if (args.length () == 2) { string label = args(0).string_value (); if (! error_state) { string callback = args(1).string_value (); if (! error_state) retval = octave_gui_button (label, octave_gui_button_callback, fcn_name); else error ("gui_button: expecting string as second arg"); } else error ("gui_button: expecting string as first arg"); } else print_usage ("gui_button"); return retval; } * The octave_gui_button_callback function will take the name of the Octave function to call. It will look something like this void octave_gui_button_callback (const string& fcn) { octave_value_list args; feval (fcn, args, 0); } * The constructor for the octave_gui_button object will take care of actually creating the button object using the appropriate toolkit code. For my purposes (trying out some ideas) libsx should be sufficient. Once this sample code is working well enough to put a few simple objects on the screen, I'll make it available with a new release of the development sources and people can take a look at it and see how their favorite toolkit will (or will not) fit in to the scheme. Then we can work out more of the details of how to define additional object types and start to integrate a real-world toolkit or two. Comments? jwe