From: Stuart L. <sl...@nc...> - 2002-07-01 04:27:41
|
> I want to be able to change the color of an object using GCL > (specifically, I want to change the color of a sphere). I cannot find > the command for this. Assuming there sphere is a top-level object (i.e. as loaded with (geometry blob ...) or (load blob ...)), you can try (merge-ap NAME { material { *diffuse R G B }}) where NAME is the object name (blob, etc.) and R G B specify the color. > I also want to not have errors when I send the GCL command (exit) to > geomview. Right now the errors look like this: > > Warning: XtRemoveGrab asked to remove a widget not on the list > > I would rather that my python program did not end with an unnecessary > warning for the user, and I cannot figure out how get rid of it. Ugh. This looks like a Motif (or maybe lesstif) internal warning message, and isn't really under geomview's control. However you might try building geomview from source with this patch applied. It simply suppresses printing any Xt-related warning messages. Stuart Levy --- src/bin/geomview/x11/gvui.c~ Fri Sep 1 17:38:07 2000 +++ src/bin/geomview/x11/gvui.c Sun Jun 30 23:15:05 2002 @@ -138,6 +138,12 @@ /*****************************************************************************/ +static void ignore_warnings( String *str ) { + /* don't print Xt warning messages, which are probably spurious anyway. */ +} + +/*****************************************************************************/ + static int panelsready = 0; void load_interface(argc, argv) @@ -246,6 +252,8 @@ TopLevel = XtAppInitialize(&App, "gv", NULL, 0, &argcblah /*&argc*/, argvblah /*argv*/, fallbacks, args, n); #endif + + XtAppSetWarningHandler( App, ignore_warnings ); XtAppAddActions(App, actions, 1); KeyAccels = XtParseAcceleratorTable(keyaccels); |