FLTK logo

[fltk.general] FLTK 1.3.4 - Setting Window icon in Linux

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.general  ]
 
Previous Message ]New Message | Reply ]Next Message ]

FLTK 1.3.4 - Setting Window icon in Linux Will B May 17, 2021  
  Greetings!

Following the instructions here https://www.fltk.org/doc-1.3/osissues.html , I tried to set my main window icon with the following code

    #include <X11/xpm.h>
    fl_open_display();                // needed if display has not been previously opened

    Pixmap pm;
    Pixmap mask;
    XpmCreatePixmapFromData(fl_display, DefaultRootWindow(fl_display), pmSpiritvnc_xpm, &pm, &mask, NULL);

    app->mainWin->icon(reinterpret_cast<void *>(pm));

Unfortunately this gives a compile error:

In file included from /usr/include/X11/Xlib.h:47,
                 from /usr/include/FL/x.H:37,
                 from /usr/include/FL/fl_draw.H:27,
                 from src/app.h:43,
                 from src/spiritvnc.cxx:47:
/usr/include/X11/xpm.h: In function ‘int main(int, char**)’:
/usr/include/X11/xpm.h:286:1: error: expected unqualified-id before string constant
 _XFUNCPROTOBEGIN
 ^~~~~~~~~~~~~~~~
src/spiritvnc.cxx:94:5: error: ‘XpmCreatePixmapFromData’ was not declared in this scope
     XpmCreatePixmapFromData(fl_display, DefaultRootWindow(fl_display), pmSpiritvnc_xpm, &pm, &mask, NULL);
     ^~~~~~~~~~~~~~~~~~~~~~~
src/spiritvnc.cxx:94:5: note: suggested alternative: ‘XCreatePixmapFromData’
     XpmCreatePixmapFromData(fl_display, DefaultRootWindow(fl_display), pmSpiritvnc_xpm, &pm, &mask, NULL);
     ^~~~~~~~~~~~~~~~~~~~~~~
     XCreatePixmapFromData

I am using antiX Linux 19.3, which is based on Debian. All the dev packages are installed and as noted on that OS Issues page, I am calling Fl_Window::show(int argc, char** argv). I also tried the XCreatePixmapFromData method, but it produces the same or similar error message. I have grepped for XpmCreatePixmapFromData in /usr/include and it does show up in X11/xpm.h.

I'm not a big Xlib user -- is there something else I should try?

PS: Google groups is very clunky for code entry and other programming-related text-editing...have you thought about using something else?

Thank you! :-)

Will Brokenbourgh

--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/95e9662d-105f-4fac-a6c5-3daf8dc48899n%40googlegroups.com.
Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.