Coder Social home page Coder Social logo

Comments (9)

MARTIMM avatar MARTIMM commented on June 29, 2024 4

Gnome::Gtk3 0.38.0 contains Gnome::Gtk3::EntryCompletion now. Knock yourself out ;-)

from gnome-gtk3.

MARTIMM avatar MARTIMM commented on June 29, 2024 1

I did not yet document the draw signal on the Widget because of a false thought that I did not yet have the CairoContext in the Gnome::Cairo package. The cairo context, however, is the cairo_t from that package. Anyways, the main problem however why the call fails is because you must describe the signal handler signature precisely. The gnome documents describe it like

gboolean
user_function (GtkWidget    *widget,
               CairoContext *cr,
               gpointer      user_data
)

The widget and user_data normally are provided as :$_widget and any :$user-data as named arguments. Those are optional and you don't need to describe them if you don't need them. However, the cairo_t parameter is obligatory; its position and its type.

So your draw handler must be something like below to get rid of the errors

use Gnome::Cairo::Types;
…
  method draw( cairo_t $cr ) {
    say 'drew';
  }
…
To get something working you must do much more. Please look

You can find a few examples in the xt directory of the Gnome::Cairo package. Especially xt/c5.raku.

from gnome-gtk3.

MARTIMM avatar MARTIMM commented on June 29, 2024 1

Hi,
I haven't yet implemented the EntryCompletion class. To get it fully functioning, I also must implement a role GtkCellLayout to make it more useful. For me, it is not yet clear which module I need to implement first and in which package. Because I was also busy writing tutorials for the Application classes and everything needed to build a complete application I was more thinking in the line of those classes involving actions and menus. Anyways, it is open for debate I assume.

There is also much rewriting going on at the moment which will break code, unfortunately. Mostly the changes are in the line of returned native objects. But now that I am adding methods for each native subroutine, these methods know at that point what to return and can therefore create a Raku object instead. Also, I can then receive and return Bool values instead of the C-integers 0 or 1 for false and true. Other types can be converted as well.

But, first things first, I need to finish the above-mentioned work!

from gnome-gtk3.

MARTIMM avatar MARTIMM commented on June 29, 2024 1

Pushed new versions;
Gnome::Glib 0.20.0
Gnome::Gio 0.18.0.1
Gnome::Gdk3 0.17.3
Gnome::Gtk3 0.37.0

from gnome-gtk3.

grenzionky avatar grenzionky commented on June 29, 2024

it worked! thanks!

from gnome-gtk3.

MARTIMM avatar MARTIMM commented on June 29, 2024

https://github.com/MARTIMM/gnome-cairo/blob/master/xt/c5.pl6

from gnome-gtk3.

grenzionky avatar grenzionky commented on June 29, 2024

c5.pl doesnt run for me, it gives me an error

width & height: 333 x 253
X valid: True
X surface state: CAIRO_STATUS_SUCCESS
X surface type: CAIRO_SURFACE_TYPE_XLIB
X surface content: CAIRO_CONTENT_COLOR_ALPHA
X surface device: cairo_device_t.new
width & height: 266 x 566
X valid: True
X surface state: CAIRO_STATUS_SUCCESS
X surface type: CAIRO_SURFACE_TYPE_XLIB
X surface content: CAIRO_CONTENT_COLOR_ALPHA
X surface device: cairo_device_t.new
width & height: 198 x 592
Y valid: True
Y surface state: CAIRO_STATUS_SUCCESS
Y surface type: CAIRO_SURFACE_TYPE_XLIB
Y surface content: CAIRO_CONTENT_COLOR_ALPHA
Y surface device: cairo_device_t.new
Type check failed in binding to parameter '$cr'; expected cairo_t but got Gnome::Cairo (Gnome::Cairo.new(is-...)
  in method draw at /home/user/.raku/sources/3094BC8DA65E28532F5887D988415015DCC37340 (Gnome::Gtk3::Widget) line 1291
  in method redraw at c5.pl6 line 226
  in sub w1 at /home/user/.raku/sources/F6AA9E9400E2588222D42E8EBDAC014B28828C6A (Gnome::GObject::Object) line 658
  in sub gtk_main at /usr/share/perl6/core/sources/947BDAB9F96E0E5FCCB383124F923A6BF6F8D76B (NativeCall) line 595
  in method FALLBACK at /home/user/.raku/sources/B402161F1A1700B2A55800B42CCB62970438CA23 (Gnome::Gtk3::Main) line 131

Cannot unbox a type object (Nil) to int.
  in sub gtk_main at /usr/share/perl6/core/sources/947BDAB9F96E0E5FCCB383124F923A6BF6F8D76B (NativeCall) line 595
  in method FALLBACK at /home/user/.raku/sources/B402161F1A1700B2A55800B42CCB62970438CA23 (Gnome::Gtk3::Main) line 131
  in block <unit> at c5.pl6 line 333

Died
  in method FALLBACK at /home/user/.raku/sources/B402161F1A1700B2A55800B42CCB62970438CA23 (Gnome::Gtk3::Main) line 118
  in block <unit> at c5.pl6 line 333

from gnome-gtk3.

MARTIMM avatar MARTIMM commented on June 29, 2024

I found a bug in method draw() in the Widget module expecting this cairo_t. This is already corrected but not yet published. Problem is that I also had to make changes in other packages as well and they must be published all at the same time because of dependencies. I'll try to get it done soon but don't want to make more mistakes either.

from gnome-gtk3.

grenzionky avatar grenzionky commented on June 29, 2024

Since I have your attention, is it currently possible to attach an EntryCompletion onto a SearchEntry using your amazing module?

I can't find the EntryCompletion class, so I thought that maybe through a N-GObject or a GObject it might be possible but I haven't been able to get it to work.

from gnome-gtk3.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.