wx.Caret cannot show on mac(version: 4.0.3 osx-cocoa (phoenix) wxWidgets 3.0.5)

Hi, all. I tried to place a blink caret on my own Ctrl(named MyCtrl which extent wx.Control) to build a customer editor like wx.TextCtrl but with more functions.

I followed https://wxpython.org/Phoenix/docs/html/wx.Caret.html#wx.Caret

The document says:

A caret is a blinking cursor showing the position where the typed text will appear.

Text controls usually have their own caret but wx.Caret provides a way to use a caret in other windows.

I assigned a wx.Caret object to be a member of MyCtrl, and called Caref.Show when MyCtrl inited. I also called MyCtrl.SetCaret to set the caref to be the caref of MyCtrl.

When the program running, I called MyCtrl.GetCaret() and printed it. Everything goes well.

But, I just CANNOT see anything blink on the showing window. The caret.Move() and caret.GetPosition() seemed goes well. But there’s no caret shows out.

I searched for wx.Caret example. But find nothing. Does anyone have experience for using wx.Caret in your project? Did I do something wrong?

Thank you for your help.

兄弟,就为了光标闪几下啊,多看看文档,应该可以吧,不是有个设置闪动时间吗?

张慧聪 zhcfreesea@gmail.com 于2018年12月6日周四 下午3:42写道:

···

Hi, all. I tried to place a blink caret on my own Ctrl(named MyCtrl which extent wx.Control) to build a customer editor like wx.TextCtrl but with more functions.

I followed https://wxpython.org/Phoenix/docs/html/wx.Caret.html#wx.Caret

The document says:

A caret is a blinking cursor showing the position where the typed text will appear.

Text controls usually have their own caret but wx.Caret provides a way to use a caret in other windows.

I assigned a wx.Caret object to be a member of MyCtrl, and called Caref.Show when MyCtrl inited. I also called MyCtrl.SetCaret to set the caref to be the caref of MyCtrl.

When the program running, I called MyCtrl.GetCaret() and printed it. Everything goes well.

But, I just CANNOT see anything blink on the showing window. The caret.Move() and caret.GetPosition() seemed goes well. But there’s no caret shows out.

I searched for wx.Caret example. But find nothing. Does anyone have experience for using wx.Caret in your project? Did I do something wrong?

Thank you for your help.

You received this message because you are subscribed to the Google Groups “wxPython-users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

One more thing, I found that if I package the program by pyinstaller, then execute it, the caret shows normal. Strange.

···

On Thursday, December 6, 2018 at 3:42:30 PM UTC+8, 张慧聪 wrote:

Hi, all. I tried to place a blink caret on my own Ctrl(named MyCtrl which extent wx.Control) to build a customer editor like wx.TextCtrl but with more functions.

I followed https://wxpython.org/Phoenix/docs/html/wx.Caret.html#wx.Caret

The document says:

A caret is a blinking cursor showing the position where the typed text will appear.

Text controls usually have their own caret but wx.Caret provides a way to use a caret in other windows.

I assigned a wx.Caret object to be a member of MyCtrl, and called Caref.Show when MyCtrl inited. I also called MyCtrl.SetCaret to set the caref to be the caref of MyCtrl.

When the program running, I called MyCtrl.GetCaret() and printed it. Everything goes well.

But, I just CANNOT see anything blink on the showing window. The caret.Move() and caret.GetPosition() seemed goes well. But there’s no caret shows out.

I searched for wx.Caret example. But find nothing. Does anyone have experience for using wx.Caret in your project? Did I do something wrong?

Thank you for your help.

把代码例子分享过来看看啊。

张慧聪 zhcfreesea@gmail.com 于2018年12月6日周四 下午5:18写道:

···

One more thing, I found that if I package the program by pyinstaller, then execute it, the caret shows normal. Strange.

On Thursday, December 6, 2018 at 3:42:30 PM UTC+8, 张慧聪 wrote:

Hi, all. I tried to place a blink caret on my own Ctrl(named MyCtrl which extent wx.Control) to build a customer editor like wx.TextCtrl but with more functions.

I followed https://wxpython.org/Phoenix/docs/html/wx.Caret.html#wx.Caret

The document says:

A caret is a blinking cursor showing the position where the typed text will appear.

Text controls usually have their own caret but wx.Caret provides a way to use a caret in other windows.

I assigned a wx.Caret object to be a member of MyCtrl, and called Caref.Show when MyCtrl inited. I also called MyCtrl.SetCaret to set the caref to be the caref of MyCtrl.

When the program running, I called MyCtrl.GetCaret() and printed it. Everything goes well.

But, I just CANNOT see anything blink on the showing window. The caret.Move() and caret.GetPosition() seemed goes well. But there’s no caret shows out.

I searched for wx.Caret example. But find nothing. Does anyone have experience for using wx.Caret in your project? Did I do something wrong?

Thank you for your help.

You received this message because you are subscribed to the Google Groups “wxPython-users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.