void PaletteHint::setText(const ustring &name, const ustring &info) { if(is_visible()) return; caption.set_markup("<b>" + name + "</b>"); this->info.set_text(" " + info + " "); Allocation a = get_allocation(); a.set_width(100); a.set_height(20); set_allocation(a); show(); }
void MyWidget::on_size_allocate(Gtk::Allocation& allocation) { //Do something with the space that we have actually been given: //(We will not be given heights or widths less than we have requested, though //we might get more) //Use the offered allocation for this container: set_allocation(allocation); if(m_refGdkWindow) { m_refGdkWindow->move_resize( allocation.get_x(), allocation.get_y(), allocation.get_width(), allocation.get_height() ); } }
/** * Does something with the space that we have actually been given. */ void GtkBlockBar::on_size_allocate(Gtk::Allocation& allocation) { // //(We will not be given heights or widths less than we have requested, though //we might get more) //Use the offered allocation for this container: set_allocation(allocation); if(m_refGdkWindow) { m_refGdkWindow->move_resize( allocation.get_x(), allocation.get_y(), allocation.get_width(), allocation.get_height() ); } }
void OSGDrawingArea::on_size_allocate (Gtk::Allocation& pAllocation) { #ifdef DEBUG //??std::cout <<"void OSGDrawingArea::on_size_allocate (Gtk::Allocation& pAllocation)<<"<< std::endl; #endif set_allocation (pAllocation); if (is_realized ()) { get_window ()->move_resize (pAllocation.get_x (), pAllocation.get_y (), pAllocation.get_width (), pAllocation.get_height ()); }//if #ifdef DEBUG //??std::cout <<"void OSGDrawingArea::on_size_allocate (Gtk::Allocation& pAllocation)>>"<< std::endl; #endif }
void Image::on_size_allocate(Gtk::Allocation &allocation) { const int width = allocation.get_width(); const int height = allocation.get_height(); int used_width = 0; int used_height = 0; set_allocation(allocation); switch (image_state) { case NONE: break; case FULL: case THUMBNAIL: used_width = width; used_height = height; if ( !unscaled_image ) { break; } case EXPAND: if ( width < post->get_width() || height < post->get_height() ) { if (width != scaled_width) { set_new_scaled_image(width, height); } else { image->set(scaled_image); } used_width = scaled_width; used_height = scaled_height; is_scaled = true; } else { if (unscaled_image) image->set(unscaled_image); else g_error("Image in EXPAND state without unscaled image data."); is_scaled = false; used_width = post->get_width(); used_height = post->get_height(); } } if (G_UNLIKELY(used_width > width || used_height > height)) { g_warning("Horizon::Image not allocated enough space!"); } event_box->size_allocate(allocation); image->size_allocate(allocation); }