[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Tool Bar hiding under the menubar
From:       Daniel de los Reyes <dadecal () teleline ! es>
Date:       2000-04-19 20:11:36
[Download RAW message or body]

My app has two menubars which are changed from one to another. The problem is
that when I change from one menubar to another , the main toolbar hides under
the new menubar. Why is this happening?

void KonStructApp::initMenuBar1()
{
	menuBar1=new KMenuBar(this);
	menuBar1->insertItem(i18n("&File"), fileMenu);
 	.................................................
	................................................
	setMenu(menuBar1);	
	menuBar1->show();
}

void KonStructApp::initMenuBar2()
{
	menuBar2=new KMenuBar(this);
	menuBar2->insertItem(i18n("&File"), fileMenu);
  	...............................................
	.............................................
	setMenu(menuBar2);	
	menuBar2->show();
}

void KonStructApp::slotChangeModule(int id_)
{
	if (id_==ID_CHANGE_TO_CALCULATION_MODULE)
	{
		delete menuBar1;
		initMenuBar2();
		toolBar()->setButton(ID_CHANGE_TO_DESIGN_MODULE, false);
		toolBar()->setItemEnabled(ID_CHANGE_TO_DESIGN_MODULE, true);
		toolBar()->setItemEnabled(ID_CHANGE_TO_CALCULATION_MODULE, false);
	}
	else
	{
		delete menuBar2;
		initMenuBar1();
		toolBar()->updateRects();
		toolBar()->setButton(ID_CHANGE_TO_CALCULATION_MODULE, false);
		toolBar()->setItemEnabled(ID_CHANGE_TO_CALCULATION_MODULE, true);
		toolBar()->setItemEnabled(ID_CHANGE_TO_DESIGN_MODULE, false);		
	}
}


 --  Daniel de los Reyes
dadecal@arq.upv.es

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic