Refreshing a selection button

OrionVeteran

Deity
Joined
Dec 25, 2003
Messages
2,443
Location
Newport News VA
I have a selection button that executes a set of functions, when pushed. It works and has no python bugs. However, the visibility function, which is executed from the CvMainInterface.py, fails to refresh upon completion of all other functions. I can select any unit on the screen and the selection buttons will refresh. The refresh makes the button disappear since the conditions to execute it no longer exist. Currently it is possible to press the button a second time, before it gets a chance to disappear. This is a bad thing for many reasons. What I need to do is force an automatic refresh of the selection buttons, but I'm not sure how to do it after the last function has ran.

Code:
if Diplomat.showBribeForWarButton(g_pSelectedUnit):
	screen.appendMultiListButton( "BottomButtonContainer", ArtFileMgr.getInterfaceArtInfo("INTERFACE_BRIBE_FOR_WAR").getPath(), 0, WidgetTypes.WIDGET_GENERAL, 698, 698, False )
	screen.show( "BottomButtonContainer" )
	iCount = iCount + 1

and

Code:
if (inputClass.getNotifyCode() == 11 and inputClass.getData1() == 698 and inputClass.getData2() == 698):
	self.pPushedButtonUnit = g_pSelectedUnit
	Diplomat.doBribeForWarMission(g_pSelectedUnit)
	CyInterface().setDirty(InterfaceDirtyBits.SelectionButtons_DIRTY_BIT, True)

Any ideas?
 
Back
Top Bottom