Skip site navigation (1) Skip section navigation (2)

Re: Crash during displaying drop-down menu for

From: Tomasz Rybak <bogomips(at)post(dot)pl>
To: Dave Page <dpage(at)vale-housing(dot)co(dot)uk>
Cc: pgAdmin Hackers <pgadmin-hackers(at)postgresql(dot)org>,Andreas Pflug <pgadmin(at)pse-consulting(dot)de>
Subject: Re: Crash during displaying drop-down menu for
Date: 2005-10-08 19:42:51
Message-ID: 1128800571.15545.10.camel@localhost.localdomain (view raw or flat)
Thread:
Lists: pgadmin-hackers
I think I know what's causing this crash.
However, I don't know where to fix it.
I'll be writing about file src/main/events.cpp.

When I right-click, frmMain::doPopup is called.
It creates new treeContextMenu, and appends all active
options from main menu. Here's how it looks just before crash:
Item 1176
0 1160 O
1 -2
2 1177 P
3 1182 U
4 -2
5 1195 W

(it's from code:
printf("Item %i\n", newMenuFactory->GetId());
size_t i;
wxMenuItemList j = treeContextMenu->GetMenuItems();
for (i=0 ; i < j.GetCount() ; i++)
{
    printf("%i %i %s\n", i, j.Item(i)->GetData()->GetId(),
j.Item(i)->GetData()->GetText().c_str());
}

It looks for menu item 1176 (New object), but this item is inactive.
However after starting pgAdmin it is active, made it so by code:
src/frm/frmMain.cpp, line 172:
newMenuFactory = new dummyActionFactory(menuFactories);     //
placeholder
where "New objects" submenu will be inserted
    editMenu->Append(newMenuFactory->GetId(), _("New &Object"), newMenu,
_("Create a new object."));

It's mede inactive after clicking on server, and remains so until
connecting to server. Then menu looks like that:
Item 1176
0 1160 O
1 -2
2 1176 N
3 1178 R
4 1182 U
5 -2
6 1195 W
And now New Object is active, so it's included in treeContextMenu.

I tried to disable deactivating newMenu by commenting out line 341:
editMenu->Enable(newMenuFactory->GetId(), false);
but it didn't work.

-- 
Tomasz Rybak <bogomips(at)post(dot)pl>


In response to

Responses

pgadmin-hackers by date

Next:From: svnDate: 2005-10-08 20:49:00
Subject: SVN Commit by andreas: r4523 - in trunk/pgadmin3: . src/include src/include/images src/main src/schema src/slony src/slony/include
Previous:From: svnDate: 2005-10-08 16:52:18
Subject: SVN Commit by andreas: r4522 - in trunk/pgadmin3: . src/dlg src/schema

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group