Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Widgets - General questions or Mixed problems » DHCtrl for GTK backend - help needed
DHCtrl for GTK backend - help needed [message #44530] Mon, 23 March 2015 16:14 Go to next message
Zbych is currently offline  Zbych
Messages: 307
Registered: July 2009
Senior Member
Hi,

I am trying to implement DHCtrl for gtk backend, to embed a gtk application in Upp window.
The problem is that I don't know how to set coordinates of gtk child window (returned by gtk_event_box_new) in Upp main window (returned by GetTopCtrl()->gtk()).

Could someone more familiar with gtk tell me how to do this properly?
I tried to use fixed layout, but in the end I need to pass GetWidget* to embedded application, not GtkFixed*.


index.php?t=getfile&id=4758&private=0
Re: DHCtrl for GTK backend - help needed [message #44618 is a reply to message #44530] Sun, 26 April 2015 12:59 Go to previous messageGo to next message
Klugier is currently offline  Klugier
Messages: 644
Registered: September 2012
Location: Poland, Kraków
Contributor
Hello Zbych,

Several weeks ago I tried to implement refined GLCtrl for GTK. But I failed, because I don't know how to embed GTKWindow inside UppWidget. Please notice that current GlCtrl implementation for GTK paints it context to pixmap then the pixmap is drawing by upp widget. As you can see this solution is slow and doesn't have several OpenGL features like double buffering.

So, I would like to ask you it is possible in current upp gtk implementation to develop DHCtrl? Did you do any progress since your last post?

Sincerely,
Klugier


Ultimate++ - one framework to rule them all.
Re: DHCtrl for GTK backend - help needed [message #44621 is a reply to message #44618] Sun, 26 April 2015 14:01 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12121
Registered: November 2005
Ultimate Member
Klugier wrote on Sun, 26 April 2015 12:59
Hello Zbych,

Several weeks ago I tried to implement refined GLCtrl for GTK. But I failed, because I don't know how to embed GTKWindow inside UppWidget. Please notice that current GlCtrl implementation for GTK paints it context to pixmap then the pixmap is drawing by upp widget. As you can see this solution is slow and doesn't have several OpenGL features like double buffering.

So, I would like to ask you it is possible in current upp gtk implementation to develop DHCtrl? Did you do any progress since your last post?

Sincerely,
Klugier



Well, I have sort of failed, thus the current GlCtrl implementation.

However, one possible plan is to turn the whole thing around: Create a new alternative Gtk backend that is using GL on toplevel window...

Mirek
Re: DHCtrl for GTK backend - help needed [message #44625 is a reply to message #44618] Sun, 26 April 2015 19:56 Go to previous messageGo to next message
Zbych is currently offline  Zbych
Messages: 307
Registered: July 2009
Senior Member
Hi Klugier,

Unfortunately I had no time to investigate it further. I need this class to embed CEF in Linux/GTK, but meantime I use Linux/X11.
Re: DHCtrl for GTK backend - help needed [message #44635 is a reply to message #44618] Fri, 01 May 2015 21:43 Go to previous messageGo to next message
Zbych is currently offline  Zbych
Messages: 307
Registered: July 2009
Senior Member
Klugier wrote on Sun, 26 April 2015 12:59

So, I would like to ask you it is possible in current upp gtk implementation to develop DHCtrl? Did you do any progress since your last post?


I made some progress. Attached version seems to be working. I tested it with embedded chromium and everything looks fine except keyboard events (embedded application doesn't receive key up/down events).

index.php?t=getfile&id=4772&private=0

[Updated on: Sat, 02 May 2015 13:37]

Report message to a moderator

Re: DHCtrl for GTK backend - help needed [message #44636 is a reply to message #44635] Sat, 02 May 2015 13:36 Go to previous messageGo to next message
Zbych is currently offline  Zbych
Messages: 307
Registered: July 2009
Senior Member
Another test case showing problem with keyboard.

index.php?t=getfile&id=4775&private=0
  • Attachment: GtkTest.7z
    (Size: 1.72KB, Downloaded 329 times)
  • Attachment: Screenshot.png
    (Size: 17.33KB, Downloaded 326 times)

[Updated on: Sat, 02 May 2015 13:38]

Report message to a moderator

Re: DHCtrl for GTK backend - help needed [message #44637 is a reply to message #44621] Sat, 02 May 2015 14:10 Go to previous messageGo to next message
Klugier is currently offline  Klugier
Messages: 644
Registered: September 2012
Location: Poland, Kraków
Contributor
mirek wrote on Sun, 26 April 2015 14:01

However, one possible plan is to turn the whole thing around: Create a new alternative Gtk backend that is using GL on toplevel window...


Hello Mirek,

I think we should develop polished and working OpenGL for GTK backend. Like we do on all other major platforms. So, I think DHCtrl is a step in good direction. When we did this It shouldn't be difficult to implement good GLCtrl.

Sincerely,
Klugier

[Updated on: Sat, 02 May 2015 14:10]

Report message to a moderator

Re: DHCtrl for GTK backend - help needed [message #50216 is a reply to message #44637] Mon, 27 August 2018 19:10 Go to previous messageGo to next message
mdelfede is currently offline  mdelfede
Messages: 1259
Registered: September 2007
Senior Contributor
Hi,

I revive this old topic because I'm trying to get DHCtrl work in GTK mode.
I tested the code posted here, it's sort of working (blinking a lot, but I guess that's solvable)
but the real caveat is that I can't add more than ONE of such to any upp TopWindow.

As I've seen, UPP is implemented using JUST one GTK top control (which is windowed) and all the
rest is drawn inside it.
The problem is that if we want to implement a windowed GTK control it should be added to the main
GTK one, and the Window type just accepts ONE widget inside it.
So, for example, having a TabBar with many pages and a DHCtrl in each page can't work.
Even using the more modern GtkArea will not work, because of this problem. We can add ONE of
it to the application, but it will crash when trying to add a second one.

I think that this problem can't be solved in GTK without some big changes in GTK core in UPP.

Ciao

Massimo

EDIT : it could be (maybe) solved using plain X11 code to add a window to the main one, and handling repositioning from inside
the DHCtrl code.

[Updated on: Mon, 27 August 2018 19:13]

Report message to a moderator

Re: DHCtrl for GTK backend - help needed [message #50222 is a reply to message #50216] Tue, 28 August 2018 11:45 Go to previous messageGo to next message
mdelfede is currently offline  mdelfede
Messages: 1259
Registered: September 2007
Senior Contributor
I'm almost done with this one.
I did it using pure X11, and I've got a control with an X11 window which can be used, for example,
to build an OpenGL control for GTK too.
I'm testing the last few stuffs and then post here.

In the attached picture, the GtkDHCtrl embedded in my UppCad application, running in GTK mode.

Ciao

Massimo

index.php?t=getfile&id=5646&private=0Hi,
  • Attachment: gtkdhctrl.png
    (Size: 273.43KB, Downloaded 135 times)
Re: DHCtrl for GTK backend - help needed [message #50223 is a reply to message #50222] Tue, 28 August 2018 12:23 Go to previous messageGo to next message
mdelfede is currently offline  mdelfede
Messages: 1259
Registered: September 2007
Senior Contributor
Here my GtkDHCtrl code.
It can be used standalone or it could be embedded in UPP CtrlCore.
In latter case it could also be simplified using protected/private members of Ctrl.

Ciao

Massimo
Re: DHCtrl for GTK backend - help needed [message #50272 is a reply to message #50223] Fri, 07 September 2018 15:31 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12121
Registered: November 2005
Ultimate Member
mdelfede wrote on Tue, 28 August 2018 12:23
Here my GtkDHCtrl code.
It can be used standalone or it could be embedded in UPP CtrlCore.
In latter case it could also be simplified using protected/private members of Ctrl.

Ciao

Massimo


There is sort of interesting issue here: AFAIK this DHCtrl flavor creates XWindow handle. But if we are GTK, should not we rather represnt GTK widget here?

Mirek
Re: DHCtrl for GTK backend - help needed [message #50277 is a reply to message #50272] Tue, 11 September 2018 07:38 Go to previous messageGo to next message
mdelfede is currently offline  mdelfede
Messages: 1259
Registered: September 2007
Senior Contributor
Quote:

There is sort of interesting issue here: AFAIK this DHCtrl flavor creates XWindow handle. But if we are GTK, should not we rather represnt GTK widget here?


Yep... I stopped at XWindow handle because that's what I need for my control, but I see no big problem to add a GTK container there.
We shall add 2 containers, a GtkWindow (attached to the XWindow handle), which can contain just ONE gtk widget (so pretty useless) and another one inside it which can then contain multiple GTK widgets.

Ciao

Massimo

p.s. : I NEVER get emails from forum... I tried to unsuscribe/resuscribe, but nothing. Even for private messages, I don't get any mail. Could you solve it ? I must scan the whole forum to know if there are replies...
Re: DHCtrl for GTK backend - help needed [message #50280 is a reply to message #50277] Wed, 12 September 2018 08:34 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 12121
Registered: November 2005
Ultimate Member
I have got your reply to gmail... Have you checked spam?
Re: DHCtrl for GTK backend - help needed [message #50282 is a reply to message #50280] Wed, 12 September 2018 09:11 Go to previous message
mdelfede is currently offline  mdelfede
Messages: 1259
Registered: September 2007
Senior Contributor
Yep... at least, on my computer. I don't know if my mail server is throwing away UPP emails, but it's quite unlikely.
I've got this problem since first day in forum. Never got an e-mail from forum...
Previous Topic: DockWindow->Button hover paint bug
Next Topic: Control4U issue with IExplorer
Goto Forum:
  


Current Time: Sun Dec 08 14:54:26 CET 2019

Total time taken to generate the page: 0.01174 seconds