May I ask a question?
well i trying to code something easy to begin, let say a floating panel in the 3dview. I followed the tutorial
Here . What i wanted to do is coding
this feature, the Object info floating box.
Now what i did so far:
BIF_space.h(56):
drawview.c(1647)
Code: Select all
static void view3d_panel_info(short cntrl) /*VIEW3d_HANDLER_INFO */
{
uiBlock *block;
View3D *vd;
vd= G.vd;
block= uiNewBlock(&curarea->uiblocks, "view3d_panel_info", UI_EMBOSS, UI_HELV, curarea->win);
uiPanelControl(UI_PNL_SOLID | UI_PNL_CLOSE | cntrl);
uiSetPanelHandler(VIEW3D_HANDLER_INFO); // for close and esc
if(uiNewPanel(curarea, block, "Object Info", "View3d", 340, 10, 318, 204)==0) return;
uiDefBut(block, LABEL, 1, "place you stuff here:", 0, 20, 76, 19, NULL, 0.0, 0.0, 0, 0, "En construction");
}
drawview.c(1682)
Code: Select all
case VIEW3D_HANDLER_INFO:
view3d_panel_info(v3d->blockhandler[a+1]);
break;
header_view3d.c(1502):
Code: Select all
uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "View Object Info", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 15, "");
What i'm trying to do is to call it from the Object menu header. But i dont have anyidea how menu is working. just tried to add the line in header_view3d.c, but when activated ether the tranform panel or the object info panle, it show up both: the transform panel and my panel. Also my panel can't be closed, if the tranform panel is closed, then the two close. N key also bring my panel up. For sure i dont understand event handler well.
How does blender think my panel is the same as the transform panel?