Bug: PropertyListBox


#1

Hi RMA,

the rs.PropertyListBox i.e. Rhino.UI.Dialogs.ShowPropertyListBox does not like utf-8 characters like Ä Ö Ü and so on. Here a python example:


# -*- coding: utf-8 -*-

import Rhino
import rhinoscriptsyntax as rs

def test():
    keys = ["key1","key2"]
    values = ["one","über"]
    results = rs.PropertyListBox(keys, values, "Edit Values")
    
    if results:
        print results
    
test()

Is there a way to work around the problem?

Thanks,
Jess


(Willem Derks) #2

Hi Jess,

Apparently the problem lies with the str() method in rs.PropertyListBox.

You can directly call Rhino.UI.Dialogs.ShowPropertyListBox() passingf your own list of stings like so:

# -*- coding: utf-8 -*-
import Rhino
import rhinoscriptsyntax as rs


def test():
    keys = ["key1","key2"]
    values = ["one","über"]
    
    results = Rhino.UI.Dialogs.ShowPropertyListBox('title', "Edit Values", keys, values)
    
    if results:
        print results
    
test()


HTH
-Willem


#3

Hi Willem,

great thanks! I too ran into that str() conversion problem some time ago…

Best,
Jess


#4

Hi @dale @stevebaer

I ran into more problems with Rhino.UI.Dialogs.ShowPropertyListBox:

  1. An empty string value “” is represented as blank " " in the dialog. This is not a big problem since I can take care of that myself. However, I think it should be fixed.

  2. If I confirm the dialog with the Right Mouse Button the attached script runs to the end, not showing any more dialogs. Is this by design? How can I avoid that?

Check out the attached sample.
PropertyListBoxBug.py (883 Bytes)

Thanks,
Jess


(Steve Baer) #5

I haven’t been able to do this at all. If I click on the OK button with the right mouse button, nothing happens (which is what I would expect.)


#6

Hi Steve,
you’ll have to click RMB outside of the dialog.


(Dale Fugier) #7

Per this conversation, I’ve added these YouTrack items;

https://mcneel.myjetbrains.com/youtrack/issue/RH-38621

The reason the form closes when you right-click off the form is because the form is display as semi-model, which means the dialog is modal but view command works (e,g. pan, zoom, rotate view). Thus, there isn’t anything that can be done about the behavior.

– Dale