TextCtrl style

wxD
Rommi
2008-09-10
2013-05-22
  • Rommi
    Rommi
    2008-09-10

    I need a password entry box. So I try to use TextCtrl with wxTE_PASSWORD flag but it doesn't work. I create object like that:

    sizer.Add(passwordCtrl = new TextCtrl(this, "",
                wxDefaultPosition, Size(100, -1),
                TextCtrl.wxTE_PASSWORD));

    But it creates a typical entry box with no asterisks masking. I have tryed setting wxTE_READONLY and wxTE_RIGHT. They also do not work. My system is Ubuntu.

     
    • The above code seems to be missing the "id" parameter ?

      http://docs.wxwidgets.org/stable/wx_wxtextctrl.html#wxtextctrlctor

       
      • Rommi
        Rommi
        2008-09-25

        Thanx! I have added -1 and it works now. But what does the constructor without this parameter do? I mean constructor which sends Window.UniqueID instead of -1. It seem not to work.

         
        • I think it just sent the params in the wrong order or something :-P

          You can use wxID_ANY instead of -1, if you dislike magic values...