mirror of
https://github.com/cemu-project/idapython.git
synced 2024-11-28 03:54:18 +01:00
kernwin.i: Title is now correctly displayed
kernwin.i: Chooser properly lists non-string items also
This commit is contained in:
parent
ca5ed24ff0
commit
97213fabb4
@ -204,23 +204,25 @@ ulong choose_choose(void *self,
|
|||||||
}
|
}
|
||||||
|
|
||||||
return choose(
|
return choose(
|
||||||
flags, // various flags: see above for description
|
flags,
|
||||||
x0, y0, // x0=-1 for autoposition
|
x0, y0,
|
||||||
x1, y1,
|
x1, y1,
|
||||||
self, // object to show
|
self,
|
||||||
width, // Max width of lines
|
width,
|
||||||
&choose_sizer, // Number of items
|
&choose_sizer,
|
||||||
&choose_getl, // Description of n-th item (1..n)
|
&choose_getl,
|
||||||
// 0-th item if header line
|
|
||||||
title ? title : deftitle,
|
title ? title : deftitle,
|
||||||
1,
|
1,
|
||||||
1,
|
1,
|
||||||
NULL,
|
NULL, /* del */
|
||||||
NULL,
|
NULL, /* inst */
|
||||||
NULL,
|
NULL, /* update */
|
||||||
NULL,
|
NULL, /* edit */
|
||||||
&choose_enter
|
&choose_enter,
|
||||||
); // number of the default icon to display
|
NULL, /* destroy */
|
||||||
|
NULL, /* popup_names */
|
||||||
|
NULL /* get_icon */
|
||||||
|
);
|
||||||
}
|
}
|
||||||
%}
|
%}
|
||||||
|
|
||||||
@ -251,8 +253,10 @@ class Choose:
|
|||||||
"""
|
"""
|
||||||
Callback: getl - get one item from the list
|
Callback: getl - get one item from the list
|
||||||
"""
|
"""
|
||||||
if n <= len(self.list):
|
if n == 0:
|
||||||
return self.list[n-1]
|
return self.title
|
||||||
|
if n <= self.sizer():
|
||||||
|
return str(self.list[n-1])
|
||||||
else:
|
else:
|
||||||
return "<Empty>"
|
return "<Empty>"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user