diff options
Diffstat (limited to 'iup/src/iup_classattrib.c')
-rwxr-xr-x | iup/src/iup_classattrib.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/iup/src/iup_classattrib.c b/iup/src/iup_classattrib.c index df8f873..3ac780c 100755 --- a/iup/src/iup_classattrib.c +++ b/iup/src/iup_classattrib.c @@ -55,7 +55,7 @@ static const char* iClassFindId(const char* name) { if (*name >= '0' && *name <= '9') return name; - if (*name == '*' || *name == ':') + if (*name == '*' || *name == ':' || *name == '-') return name; name++; @@ -94,7 +94,6 @@ int iupClassObjectSetAttribute(Ihandle* ih, const char* name, const char * value const char* name_id = iClassFindId(name); if (name_id) { - IattribFunc* afunc; const char* partial_name = iClassCutNameId(name, name_id); if (!partial_name) partial_name = "IDVALUE"; /* pure numbers are used as attributes in IupList and IupMatrix, @@ -474,8 +473,12 @@ void iupClassObjectEnsureDefaultAttributes(Ihandle* ih) (afunc->call_global_default && iupGlobalDefaultColorChanged(afunc->default_value))) { if ((!ih->handle && (afunc->flags & IUPAF_NOT_MAPPED)) || - (ih->handle && !(afunc->flags & IUPAF_NOT_MAPPED) && !iupAttribGet(ih, name))) - afunc->set(ih, iClassGetDefaultValue(afunc)); + (ih->handle && !(afunc->flags & IUPAF_NOT_MAPPED))) + { + char* value = iupAttribGet(ih, name); + if (!value) /* if set will be updated later */ + afunc->set(ih, iClassGetDefaultValue(afunc)); + } } } |