Re: Notebooks in Gtk+ v1.2.x



Jim Parker wrote:
G'Day !

Well no one responded to my last message. I'll assume it is do to my poor communication skills and not being filtered to /dev/null ;-)

I am developing a CAD program. What I am trying to do is have multiple drawing areas (OpenGL) available via a notebook. Each drawing area needs access to the toolbar and menus, but should have diffrent scale factors and viewing angles, among other things. It is not known how many possible drawing areas will be open at any given time.

I have been able to create the notebook and a couple of windows, but can not figure out how to get them to respond to menu commands independently.

My current thought is to create a struct, something like:

    typedef struct {
      GtkWidget  *notebook_page;
      GtkWidget  *drawing_area;
      gint        page_number;
      gfloat      xRotation;
      gfloat      yRotation;
          gfloat      zRotation;
          gfloat      scale;
    } typNotebookPage;

Now as I add a drawing area, I can fill the struct and add it to a linked list.

Now here is where I am confused. I figure that, I can find the node in the linked list during a page switch event, and use the memory address to assign to a "current" struct, giving me access to the scale and rotation variables. This somehow does not seem to be the best way to do it. I think that I will still have all my drawing areas respond to menu commands, when in affect they shoud be frozen.

My guess is that what I am trying to do is something similar to what the do with spreadsheets. I tried to figure out how gnumeric did it, but got lost trying to follow the code.

Anybody have any thoughts or suggestions on this problem. Am I on the right track ?

cheers,
Jim Parker

http://gtkcad.sourceforge.net/
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Ok maybe I am going to get to simple here :) What about naming your elements in the page to reflect page #. So example: entry1 becomes 1_entry1. Now if you hit the page to determine the # you can simply prepend it to the element name and your menu hits that element. No idea if that would work just an off the cuff idea.

Steve




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