Subclassing on a GtkSourceMark

2019-04-15 Thread Zdravetz via gtk-app-devel-list



Hello guys!


While I was developing my application I just wished that I had more control
on the way GtkSourceMarks render (yes, I am using the GtkSourceViewModule)
GTK+ is amazing in all aspects. Including the sources. So I ask you, who
know GTK+ sources better, could you please provide me with some
Assistance.


Since GtkSourceGutter, GtkSourceGutterRenderer, GtkSourceMark and
GtkSourceMarkAttributes is all coded up so that size of the pixbuf in the
gutter solely depends on the size of the font. I would like to subclass it
and override the rendering signal so that it uses custom sizes.


Could you tell me what function in what source file I had to change to do
that?
I hope it will be as simple as subclassing on GtkSourceMark and changing a
line or two in the draw signal, because I don't have much time to be honest
and I am attempting now to be time-efficient.
Thanks in advance.

-
Mail.BG: Безплатен e-mail адрес. Най-добрите характеристики на българския пазар 
- 30 GB пощенска кутия, 1 GB прикрепен файл, безплатен POP3, мобилна версия и 
други. http://mail.bg
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

RE: gtk3 drag and drop sample/demo

2019-04-15 Thread Pankaj Bansal via gtk-app-devel-list
Hello Emmanaele,

 

Thanks for replying and sorry if I sounded unreasonable to go and check the 
issue. I was referring to look at the issue and reproducer for the issue. 

 

Issue:

In Ubuntu 16.04 (gtk3.18) all works fine for in JavaFX. 

For Ubuntu 18.04 (gtk3.20 or later), the dnd stops working. I have found that 
we are not getting any calls from gtk side. I mean gtk is not calling the event 
callback function. I see that there is only one DragEnter event, one DragMotion 
event and then one DragEnd event. Whereas with gtk 3.18, we get many 
DragMotionm events which is what supposed to happen. 

 

Below is a sample code, which can be used to easily see the issue. It is using 
the JavaFX for dnd.

 

I was hoping to get hands on some dnd native sample/demo which works fine with 
gtk3.20 or later. But if you are saying that nothing has changed, so I have to 
see what makes our code stop working from gtk3.20

 

 

//Sample Fx11draggError.java

 

import javafx.application.Application; 

import javafx.scene.Scene; 

import javafx.scene.control.Button; 

import javafx.scene.input.ClipboardContent; 

import javafx.scene.input.TransferMode; 

import javafx.stage.Stage; 

public class Fx11draggError extends Application{ 

@Override 

public void start(Stage stage) throws Exception { 

   Button button = new Button("test"); 

   button.setOnDragDetected(e -> { 

  System.out.println("Drag detected");

  ClipboardContent content = new 
ClipboardContent(); 

      content.putString("It works"); 

  
button.startDragAndDrop(TransferMode.COPY).setContent(content); 

  e.consume(); 

   }); 

button.setOnDragOver((ev)-> {System.out.println("Drag over"); 
ev.consume();}); 

button.setOnDragDropped((ev)-> {System.out.println("Drag end"); 
ev.consume();}); 

button.setOnDragDone((ev)-> {System.out.println("Drag done"); 
ev.consume();}); 

   stage.setScene(new Scene(button, 200, 200)); 

   stage.show(); 

} 

public static void main(String[] args) { 

launch(); 

} 

}

 

-Pankaj

 

From: Emmanuele Bassi [mailto:eba...@gmail.com] 
Sent: Monday, April 15, 2019 5:26 PM
To: Pankaj Bansal
Cc: gtk-app-devel-list list
Subject: Re: gtk3 drag and drop sample/demo

 

On Mon, 15 Apr 2019 at 12:45, Pankaj Bansal via gtk-app-devel-list mailto:gtk-app-devel-list@gnome.org"gtk-app-devel-list@gnome.org> wrote:

 

I am working with OpenJDK JavaFX dev group and we are facing some problems with 
drag and drop functionality with gtk3.20 or later. You can have a look at the 
bug for more information https://bugs.openjdk.java.net/browse/JDK-8211302. It 
will be great if someone can point out any big change done with respect to drag 
and drop from gtk3.20.

 

First of all, it's kind of rude to ask people to go to a random bug tracker and 
ask for a code review without stating what the issue is.

 

Can you explain what issues are you experiencing?

 

I am looking for a sample/demo for drag and drop functionality using gtk3. I 
can see that there is one demo at [1], but it is not compatible with gtk3 as it 
is using gtk4 specific structs and functions. I am not able to find any other 
working demo/sample working with gtk3. It would be great if anyone can point to 
me to something useful.

 

The drag and drop code in GTK 3 hasn't really changed from the 2.x days, and 
has been substantially reworked for GTK 4.

 

The old drag and drop tutorial may be of help: HYPERLINK 
"https://urldefense.proofpoint.com/v2/url?u=https-3A__wiki.gnome.org_Newcomers_DragNDropTutorial=DwMFaQ=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE=nHVEjVI-guB2suhUDbwru96xVVrQOkjZ4oHvLp8rBFo=k76mPqvxlua5kHEVFWSnXbdNteF7JdealQN3v-KVELc=3cUNH1P03apgAfDvBiT0NPIXKGbGVyAOQ2uhcFlSjzY="https://wiki.gnome.org/Newcomers/DragNDropTutorial

 

Ciao,

 Emmanuele.

 

-- 

HYPERLINK 
"https://urldefense.proofpoint.com/v2/url?u=https-3A__www.bassi.io=DwMFaQ=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE=nHVEjVI-guB2suhUDbwru96xVVrQOkjZ4oHvLp8rBFo=k76mPqvxlua5kHEVFWSnXbdNteF7JdealQN3v-KVELc=adNpmoTJk5ufLg6lUH49hjZcSXWNzTTWCMInMXMuGs4="https://www.bassi.io
[@] ebassi [@HYPERLINK 
"https://urldefense.proofpoint.com/v2/url?u=http-3A__gmail.com=DwMFaQ=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE=nHVEjVI-guB2suhUDbwru96xVVrQOkjZ4oHvLp8rBFo=k76mPqvxlua5kHEVFWSnXbdNteF7JdealQN3v-KVELc=1HMnpf-boburUX2mA71lOOnlacW-IU1aoV3WwBRXQEY="gmail.com]
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: gtk3 drag and drop sample/demo

2019-04-15 Thread Emmanuele Bassi via gtk-app-devel-list
On Mon, 15 Apr 2019 at 12:45, Pankaj Bansal via gtk-app-devel-list <
gtk-app-devel-list@gnome.org> wrote:


> I am working with OpenJDK JavaFX dev group and we are facing some problems
> with drag and drop functionality with gtk3.20 or later. You can have a look
> at the bug for more information
> https://bugs.openjdk.java.net/browse/JDK-8211302. It will be great if
> someone can point out any big change done with respect to drag and drop
> from gtk3.20.
>

First of all, it's kind of rude to ask people to go to a random bug tracker
and ask for a code review without stating what the issue is.

Can you explain what issues are you experiencing?


> I am looking for a sample/demo for drag and drop functionality using gtk3.
> I can see that there is one demo at [1], but it is not compatible with gtk3
> as it is using gtk4 specific structs and functions. I am not able to find
> any other working demo/sample working with gtk3. It would be great if
> anyone can point to me to something useful.
>

The drag and drop code in GTK 3 hasn't really changed from the 2.x days,
and has been substantially reworked for GTK 4.

The old drag and drop tutorial may be of help:
https://wiki.gnome.org/Newcomers/DragNDropTutorial

Ciao,
 Emmanuele.

-- 
https://www.bassi.io
[@] ebassi [@gmail.com]
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


gtk3 drag and drop sample/demo

2019-04-15 Thread Pankaj Bansal via gtk-app-devel-list
Hi All,

 

I am working with OpenJDK JavaFX dev group and we are facing some problems with 
drag and drop functionality with gtk3.20 or later. You can have a look at the 
bug for more information https://bugs.openjdk.java.net/browse/JDK-8211302. It 
will be great if someone can point out any big change done with respect to drag 
and drop from gtk3.20.

 

I am looking for a sample/demo for drag and drop functionality using gtk3. I 
can see that there is one demo at [1], but it is not compatible with gtk3 as it 
is using gtk4 specific structs and functions. I am not able to find any other 
working demo/sample working with gtk3. It would be great if anyone can point to 
me to something useful.

 

[1] https://github.com/GNOME/gtk/blob/master/demos/gtk-demo/dnd.c

 

-Pankaj
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list