g++ - TextView Gtkmm - Changing Size -




i trying build window in gtkmm. of widgets appearing, cannot adjust height of textviews. have tried set_border_window_size() , set_size_request(), neither working. is, not changing aspect of textview size.

here window constructor:

udpwindow::udpwindow() : gtk::applicationwindow(), box_hbox(gtk::orientation_horizontal, 7), box_vbox1(gtk::orientation_vertical, 7), box_vbox2(gtk::orientation_vertical, 7), box_sentdata(gtk::orientation_vertical, 7), box_receiveddata(gtk::orientation_vertical, 7), frm_sentdata("sent data"), frm_receiveddata("received data"), lbl_sendmessage("message send"), lbl_senddevice("select device"), btn_send("send message"), btn_quit("quit"), comms(null) { // set udp communications //comms = new udp_communicator(); uchar device[3] = {1, 2, 3}; /*device[0] = comms->createnewsocket(52088, "192.168.1.2", 2); device[1] = comms->createnewsocket(8090, "192.168.1.3", 2); device[2] = comms->createnewsocket(48183, "192.168.1.4", 2);  comms->start(); comms->postmessage(msg_add_device_to_handshake, "", device[0]); comms->postmessage(msg_add_device_to_handshake, "", device[1]); comms->postmessage(msg_start_handshake, "", 0);*/  //fill combo box std::stringstream str; str << (int)device[0]; cmb_senddevice.append(str.str()); str.str(std::string()); str.clear(); str << (int)device[1]; cmb_senddevice.append(str.str()); str.str(std::string()); str.clear(); str << (int)device[2]; cmb_senddevice.append(str.str());  cmb_senddevice.set_active(0);  // set message text box txt_sendmessage.set_max_length(50); txt_sendmessage.set_text("enter message");  // set quit button btn_quit.signal_clicked().connect(sigc::mem_fun(*this, &udpwindow::on_btn_quit));  // set send button btn_send.signal_clicked().connect(sigc::mem_fun(*this, &udpwindow::on_btn_send));  // set sent data scroll text txt_sentdata.set_editable(false); txt_sentdata.set_border_window_size(gtk::text_window_top, 15); txt_sentdata.set_border_window_size(gtk::text_window_bottom, 15); txt_sentdata.set_border_window_size(gtk::text_window_left, 100); txt_sentdata.set_border_window_size(gtk::text_window_right, 100); txt_sentdata.set_size_request(-1, 100); scrl_sentdata.add(txt_sentdata); scrl_sentdata.set_policy(gtk::policy_automatic, gtk::policy_automatic);   // set received data scroll text txt_receiveddata.set_editable(false); scrl_receiveddata.add(txt_receiveddata); scrl_receiveddata.set_policy(gtk::policy_automatic, gtk::policy_automatic);   add(box_hbox); box_hbox.pack_start(box_vbox1, gtk::pack_shrink);  box_sentdata.pack_start(lbl_senddevice, gtk::pack_shrink); box_sentdata.pack_start(cmb_senddevice, gtk::pack_shrink); box_sentdata.pack_start(lbl_sendmessage, gtk::pack_shrink); box_sentdata.pack_start(txt_sendmessage, gtk::pack_shrink); box_sentdata.pack_start(btn_send, gtk::pack_shrink); box_sentdata.pack_start(scrl_sentdata, gtk::pack_shrink); frm_sentdata.add(box_sentdata); box_vbox1.pack_start(frm_sentdata, gtk::pack_shrink);  box_hbox.pack_start(box_vbox2, gtk::pack_shrink);  box_receiveddata.pack_start(scrl_receiveddata, gtk::pack_shrink); box_receiveddata.pack_start(btn_quit, gtk::pack_shrink); frm_receiveddata.add(box_receiveddata); box_vbox2.pack_start(frm_receiveddata, gtk::pack_shrink);  this->show_all();  } 

there set_default_size() function attached gtk::window, widget textview doesn't seem have access it. @ loss on do.

the above posted code has both set_border_window_size() , set_size_request() included though 1 set of functions used @ time.

because textview inside scrolledwindow, scrolledwindow's attributes determines size.

scrl_sentdata.set_size_request(-1, 100);





wiki

Comments

Popular posts from this blog

python - Read npy file directly from S3 StreamingBody -

python - Minimize function with Scipy minimize -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -