Re: XForms: need to detect resized form

From: Steve Lamont (spl@ncmir.ucsd.edu)
Date: Tue Apr 24 2001 - 09:39:17 EDT

  • Next message: Rouben Rostamian: "Re: XForms: need to detect resized form"

    # To subscribers of the xforms list from Steve Lamont <spl@ncmir.ucsd.edu> :

    > I tried fl_register_raw_callback() and looked for ConfigureNotify.
    > Unfortunately the callback is called as a pre-handler rather than
    > a post-handler, therefore it has no knowledge of the new dimensions
    > of the form.

    Did you check the innards of the XConfigureEvent? That contains the
    new dimensions of the form. The following snippet of code illustrates:

      int handler( FL_FORM *form, void *xevent )
      
      {
      
          XEvent *xev = ( XEvent *) xevent;
      
          if ( xev->type == ConfigureNotify ) {
      
              XConfigureEvent *configure_event = ( XConfigureEvent *) xevent;
              
              fprintf( stderr, "x = %d, y = %d, w = %d, h = %d\n",
                       configure_event->x, configure_event->y,
                       configure_event->width, configure_event->height );
      
          }
          return 0;
      
      }
      
      
      int main(int argc, char *argv[])
      {
          FD_try *fd_try;
          
          fl_initialize(&argc, argv, 0, 0, 0);
          fd_try = create_form_try();
          
          fl_show_form(fd_try->try,FL_PLACE_CENTERFREE,FL_FULLBORDER,"try");
          fl_register_raw_callback( fd_try->try,
                                    FL_ALL_EVENT,
                                    handler );
          fl_addto_selected_xevent( fd_try->try->window,
                                    StructureNotifyMask );
      
          fl_do_forms();
          return 0;
      }
      
                                                            spl
    _________________________________________________
    To unsubscribe, send the message "unsubscribe" to
    xforms-request@bob.usuhs.mil or see
    http://bob.usuhs.mil/mailserv/xforms.html
    XForms Home Page: http://world.std.com/~xforms
    List Archive: http://bob.usuhs.mil/mailserv/list-archives/



    This archive was generated by hypermail 2b29 : Tue Apr 24 2001 - 09:46:58 EDT