[gtkada] Flip data or objects within a window

Martin Klaiber martinkl at zedat.fu-berlin.de
Wed Feb 26 21:50:42 CET 2003


Hi,

I want to flip data or objects within a window from top to bottom and
vice versa. Imagine you have a window like that:

   -------------------------
  |                         |
  |       Some output       |
  |                         |
  | ----- A separator ----- |
  |                         |
  |   Input, like buttons   |
  |   or entry-fields.      |
  |                         |
  | ----- A separator ----- |
  |                         |
  |     [ Flip-Button ]     |
   -------------------------

When the user presses the Flip-Button, the upper part of the window
must flip, so that it looks like that:

   -------------------------
  |                         |
  |   Input, like buttons   |
  |   or entry-fields.      |
  |                         |
  | ----- A separator ----- |
  |                         |
  |       Some output       |
  |                         |
  | ----- A separator ----- |
  |                         |
  |     [ Flip-Button ]     |
   -------------------------

The content of the window is build by packing the result of functions
into VBoxes like that:

  function Make_Output return Gtk_Scrolled_Window is
  ...
  function Make_Input return Gtk_Scrolled_Window is
  ...
  
  procedure Initialize () is
  begin
    Gtk_New (Objectname.Win);
    ...
    Gtk_New_VBox (VBox, False);
    Add (Objectname.Win, VBox);
    
    If Output_At_Top then
      Pack_Start (VBox, Make_Output, False, False);
      Gtk_New_HSeparator (Separator);
      Pack_Start (VBox, Separator, ...);
      Pack_Start (VBox, Make_Input, True, True);
    else
      ...
    
Do I have to destroy the window, or at least the VBox and rebuild it,
or is there a build-in-function in GtkAda, to flip the order of the
content of the VBox?

TIA,
Martin



More information about the gtkada mailing list