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

List:       kde-devel
Subject:    Re: enable/disable actions
From:       Thomas Baumgart <ipwizard () users ! sourceforge ! net>
Date:       2005-12-07 18:13:45
Message-ID: 200512071913.50506 () net-bembel ! de
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


Hi all,

on Wednesday 07 December 2005 14:36, Bram Biesbrouck wrote:

> Hi,
>
> Can anyone tell me what's the best way to enable or disable actions from
> (deep) within a program's code? Currently, I'm using this:
>
> 	KMainWindow* kmwin = dynamic_cast<KMainWindow*>(topLevelWidget());
> 	if (kmwin)
> 	    kmwin->action("justAnAction")->setEnabled(true);
>
> I'm aware this doesn't always work if the topLevelWidget isn't a
> KMainWindow, but it does in my case.
> But  it doesn't look that pretty and it isn't very manageable. Maybe
> using state changes, but that doesn't change the fact the mainWin is
> accessed from all over the program.
>
> any thoughts?

Maybe [1] gives you some ideas on how to solve this problem.

[1] http://developer.kde.org/documentation/tutorials/xmlui/notes.html

-- 

Regards

Thomas Baumgart

thb@net-bembel.de               Check the KMyMoney open source
http://www.net-bembel.de/       project at http://kmymoney2.sf.net/

public key available under thb@net-bembel.de  at  http://www.keyserver.net
GPG-FP: E55E D592 F45F 116B 8429   4F99 9C59 DB40 B75D D3BA
-------------------------------------------------------------
'I used that other operating system* (now to be considered
open source? <g>) for some years' - anonymous source
-------------------------------------------------------------

[Attachment #5 (application/pgp-signature)]

>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<


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

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