From: Detlef W. <det...@gm...> - 2016-11-18 05:18:30
|
Am 12.11.2016 um 07:52 schrieb Kouhei Sutou: > Hi, Hi, > > In <919...@gm...> > "[ruby-gnome2-devel-en] No Gdk::Window and Pixbuf not shown" on Fri, 11 Nov 2016 20:31:11 +0100, > Detlef Wagner <det...@gm...> wrote: > >> First: >> ====== >> >> require 'gtk3' >> >> win = Gtk::Window.new >> >> pixbuf = GdkPixbuf::Pixbuf.new :path => 'img.png', :width => 64, :height >> => 64 >> >> img = Gtk::Image.new >> img.pixbuf = pixbuf >> #img = Gtk::Image.new :file => 'img.png' >> >> win.add img >> win.show_all >> Gtk.main > > You should use :file instead of :path for GdkPixbuf::Pixbuf.new: > > GdkPixbuf::Pixbuf.new :file => 'img.png' > Stupid me. Thank you for the hint! Should GdkPixbuf::Pixbuf.new show a warning or throw an exception if parameters are not known? Like in Gtk::TreeViewColumn of the pull-request I created some days ago? > The API isn't changed at least in recent releases. Sorry, but I was not clear and right in the last message. First, the changes where not meant to be of ruby-gtk, but in Gtk+. Sorry for the noise. And then neither API nor ABI change, but change in behavior. More on this at the bottom. > >> Second: >> ======= >> >> require 'gtk3' >> >> win = Gtk::Window.new >> win.signal_connect(:draw) do >> p win.window.class >> end >> win.show_all >> Gtk.main >> >> >> The output is: >> #<Class:0x00000001f5b9b8> >> >> but I belief that it should be: >> Gdk::Window > > Try: > > win.signal_connect(:draw) do > p win.window.class > p win.window.class.gtype > p win.window.class.ancestors > end > > You'll get the following output: > > #<Class:0x0055ba4fe75b58> > GLib::Type["GdkX11Window"] > [#<Class:0x0055ba4fe75b58>, Gdk::Window, GLib::Object, GLib::Instantiatable, Object, Kernel, BasicObject] > > #<Class:0x0055ba4fe75b58> is a subclass of Gdk::Window. It > depends on your windows system. > Thank you for clarification. Looks a little bit strange to me, but I get it :-) > This API isn't also changed at least in recent releases. > >> And then I have the problem, that configure events in combination with >> Gtk::DrawingArea s are give not the right size of the area. But this is >> in a quite complex program and I first try to track it down. > > If we have a script that reproduce the problem, we may fix it. > It seems to be a change in Gtk+. The DrawingArea in placed in a Gtk::Paned. If I change the position of the paned with Gtk::Paned#position= on first start up _after_ Gtk::Window#show_all, I get a wrong size in the configure event. If I change the position before show_all, all is like expected. I will try to make a shall example of this. Thank you! Cheers, detlef >> For me, it seams that the gtk API and ABI compatibility is brocken :-( > > We should fix unexpected API incompatibilities. > > > Thanks, > -- > kou > > ------------------------------------------------------------------------------ > Developer Access Program for Intel Xeon Phi Processors > Access to Intel Xeon Phi processor-based developer platforms. > With one year of Intel Parallel Studio XE. > Training and support from Colfax. > Order your platform today. http://sdm.link/xeonphi > _______________________________________________ > ruby-gnome2-devel-en mailing list > rub...@li... > https://lists.sourceforge.net/lists/listinfo/ruby-gnome2-devel-en > |