Hey, Darwin,

the following are sample code to insert a button to the current cursor position:

                        TextView textView = ...;
                         ...
                        TextBuffer buffer = textView.Buffer;
                        var iter = 
buffer.GetIterAtOffset(buffer.CursorPosition);
                        var anchor = buffer.CreateChildAnchor(ref iter);
                        Button btn = new Button();
                        btn.Label = "Hello";
                        textView.AddChildAtAnchor(btn, anchor);
                        btn.ShowAll();

You may also want to install/run the gtk-demo, and dig the source code
of "Text Widges|Multiple Views" demo.

On Sun, Jul 19, 2009 at 7:26 AM, Darwin Reynoso<[email protected]> wrote:
> Hi,
> how do i insert a widget like a button or combobox to a textview.
>
> thank you
> _______________________________________________
> Gtk-sharp-list maillist  -  [email protected]
> http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
>



-- 
B.R.
GUO Rui (Matt)
_______________________________________________
Gtk-sharp-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/gtk-sharp-list

Reply via email to