Re: Why check menu item always return FALSE ?




Thanks, I have resolved the problem.

From: "David Necas (Yeti)" <yeti physics muni cz>
To: jacky618 jacky618 <hhd618 hotmail com>
CC: gtk-list gnome org
Subject: Re: Why check menu item always return FALSE ?
Date: Fri, 13 Aug 2004 10:05:27 +0200

On Fri, Aug 13, 2004 at 03:55:48PM +0800, jacky618 jacky618 wrote:
>
>  I have made a check menu with Gtk+, however, it always returns FALSE:
>
>    if (GTK_CHECK_MENU_ITEM(ckMnItem)->active == TRUE)

Never access the widget struct directly (except for fields
declared public). Alaways do

    if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(ckMnItem)))
        ...

Using (something == TRUE) instead of (something) is not an
excellent idea either.

Yeti


--
Do not use tab characters. Their effect is not predictable.

_________________________________________________________________
与联机的朋友进行交流,请使用 MSN Messenger: http://messenger.msn.com/cn



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]