Get x11 id from wxwindows

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Post Reply
pichlik
In need of some credit
In need of some credit
Posts: 6
Joined: Wed Feb 09, 2011 5:41 am

Get x11 id from wxwindows

Post by pichlik » Wed Feb 09, 2011 3:30 pm

Hi. please,I need to find out how can iget the x11 window system id from a wxwidgets window.

My window

Code: Select all

OknoVidea::OknoVidea(wxWindow* parent,wxWindowID id,const wxPoint& pos,const wxSize& size)
{
	//(*Initialize(OknoVidea)
	Create(parent, id, _("OknoVidea"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE, _T("id"));
	SetClientSize(wxDefaultSize);
	Move(wxDefaultPosition);
	//*)
And VLC Player,who needs rights of my windows id created with wxWidgets.

Code: Select all

libvlc_media_player_set_xwindow ( libvlc_media_player_t *p_mi, uint32_t drawable );
I've tried the id of the window function is achieved by OknoVidea::GetId ();, but unfortunately, the connection worked. id function returned matters to me was different than I learned with xwininfo.

Thank you in advance for every answer.

DavidHart
Site Admin
Site Admin
Posts: 3889
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Post by DavidHart » Wed Feb 09, 2011 3:50 pm

Hi,

Does the third post in the FAQ help?

Also, http://forums.wxwidgets.org/viewtopic.php?t=29850 looks highly relevant.

Regards,

David

pichlik
In need of some credit
In need of some credit
Posts: 6
Joined: Wed Feb 09, 2011 5:41 am

Post by pichlik » Wed Feb 09, 2011 8:49 pm

DavidHart wrote:Hi,

Does the third post in the FAQ help?

Also, http://forums.wxwidgets.org/viewtopic.php?t=29850 looks highly relevant.

Regards,

David
Thank you for the link, I did not see him. Unfortunately, the compilation will stop on the line

Code: Select all

extern "C" {
and outputs an error

Code: Select all

/usr/include/wx-2.8/wx/gtk/win_gtk.h|15|error: expected unqualified-id before string constant|

DavidHart
Site Admin
Site Admin
Posts: 3889
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Post by DavidHart » Wed Feb 09, 2011 9:26 pm

Difficult to say. Perhaps check the lines above, in case you missed a ';' (or similar).

User avatar
evstevemd
Part Of The Furniture
Part Of The Furniture
Posts: 2259
Joined: Wed Jan 28, 2009 11:57 am
Location: United Republic of Tanzania
Contact:

Post by evstevemd » Wed Feb 09, 2011 9:49 pm

pichlik wrote:
DavidHart wrote:Hi,

Does the third post in the FAQ help?

Also, http://forums.wxwidgets.org/viewtopic.php?t=29850 looks highly relevant.

Regards,

David
Thank you for the link, I did not see him. Unfortunately, the compilation will stop on the line

Code: Select all

extern "C" {
and outputs an error

Code: Select all

/usr/include/wx-2.8/wx/gtk/win_gtk.h|15|error: expected unqualified-id before string constant|
Which one did you tried? I can see this Link is without any extern "C" and OP said it worked!
Chief Justice: We have trouble dear citizens!
Citizens: What it is his honor?
Chief Justice:Our president is an atheist, who will he swear to?
[Ubuntu 19.04/Windows 10 Pro/MacOS 10.13 - GCC/MinGW/Clang, CodeLite IDE]

upCASE
Site Admin
Site Admin
Posts: 3176
Joined: Mon Aug 30, 2004 6:55 am
Location: Germany, Cologne

Post by upCASE » Thu Feb 10, 2011 7:38 am

Hi!
As I see you're trying to embed VLC in a wxWidgets app.
That's exactly what I do and it works perfectly well, given you use the way of obtaining the XID like I mentioned in the other post.

Where does that extern "C" come from?
In libvlc.h this is use, but guarded with an ifdef block.
Are you trying to compile somehting a C code instead of C++?
Check if the extern "C" is guarded like

Code: Select all

# ifdef __cplusplus
extern "C" {
# endif
and make sure that you're not missing the closing brace to this block.
OS: OpenSuSE, Ubuntu, Win XP Pro
wx: svn
Compiler: gcc 4.5.1, VC 2008, eVC 4

"If it was hard to write it should be hard to read..." - the unknown coder
"Try not! Do. Or do not. There is no try." - Yoda

pichlik
In need of some credit
In need of some credit
Posts: 6
Joined: Wed Feb 09, 2011 5:41 am

Post by pichlik » Thu Feb 10, 2011 10:58 pm

Thanks, it works perfect, an error has been improperly inserted # include

User avatar
evstevemd
Part Of The Furniture
Part Of The Furniture
Posts: 2259
Joined: Wed Jan 28, 2009 11:57 am
Location: United Republic of Tanzania
Contact:

Post by evstevemd » Thu Feb 10, 2011 11:22 pm

pichlik wrote:Thanks, it works perfect, an error has been improperly inserted # include
Just curious, are you using libvlc? I was just reading about it today that is why I ask :D
Chief Justice: We have trouble dear citizens!
Citizens: What it is his honor?
Chief Justice:Our president is an atheist, who will he swear to?
[Ubuntu 19.04/Windows 10 Pro/MacOS 10.13 - GCC/MinGW/Clang, CodeLite IDE]

pichlik
In need of some credit
In need of some credit
Posts: 6
Joined: Wed Feb 09, 2011 5:41 am

Post by pichlik » Fri Feb 11, 2011 12:34 am

Yes We create SDL application GUI, wxWidgets use on user preferences and also to create a window in which I play a video file.

At the moment still addresses both the window created in wxWidgets displayed on the second monitor

Monitor 1 -> SDL fullscreen applications
Monitor2-> window with wxWidgets libvlc to play video in fullscreen

I have a Matrox graphics card with two video outputs.

It occurred to me to create one large work area and have to split in half. (However, I fear that it will make trouble if I have different resolutions.

Post Reply