Simple Cairo demo for Linux

Вопросы программирования и использования MSEide + MSEgui.

Модератор: Модераторы

Ответить
Аватара пользователя
Roland
новенький
Сообщения: 25
Зарегистрирован: 23.03.2021 15:27:18
Откуда: France
Контактная информация:

Simple Cairo demo for Linux

Сообщение Roland »

Hello!

I was looking since a long time to find a way to use the Cairo library in a MSEgui window. Today I could make a first working example, using a twindowwidget. I post it here, in case someone would be interested.

It is only for Linux.

screenshot.png
screenshot.png (7.92 КБ) 35950 просмотров


Best regards from France.

Roland
Вложения
msegui-cairo-demo-twindowwidget-01.zip
(6.38 КБ) 798 скачиваний
Аватара пользователя
Alexander
энтузиаст
Сообщения: 864
Зарегистрирован: 18.12.2005 18:10:00
Откуда: оттуда
Контактная информация:

Сообщение Alexander »

Thank You
Roland.

This is a progressive invention.
Аватара пользователя
Roland
новенький
Сообщения: 25
Зарегистрирован: 23.03.2021 15:27:18
Откуда: France
Контактная информация:

Сообщение Roland »

Thank you for the compliment Alexander.

Here is another example: a simple animation, using a ttimer.

screenshot.png
Вложения
msegui-cairo-demo-twindowwidget-ttimer-01.zip
(6.77 КБ) 797 скачиваний
Аватара пользователя
Roland
новенький
Сообщения: 25
Зарегистрирован: 23.03.2021 15:27:18
Откуда: France
Контактная информация:

Сообщение Roland »

Hello everybody!

Another Cairo demo. An animated spiral. Idea coming from this example.
example7.png
Best regards from France.

Roland
Вложения
example7.zip
(7.98 КБ) 578 скачиваний
Аватара пользователя
Alexander
энтузиаст
Сообщения: 864
Зарегистрирован: 18.12.2005 18:10:00
Откуда: оттуда
Контактная информация:

Сообщение Alexander »

Thank You, Roland !

I make type casting for fpc 3.3.1 and run it.

Код: Выделить всё

  scr := XDefaultScreen(XLIB.Pdisplay(msedisplay));
  vis := XDefaultVisual(XLIB.Pdisplay(msedisplay), scr);
  {
  XClearWindow(msedisplay, sender.clientwinid);
  }
  sf := cairo_xlib_surface_create(XLIB.Pdisplay(msedisplay), sender.clientwinid, vis, widgetwidth, widgetheight);
http://soft.self-made-free.ru/spiral.webm
Аватара пользователя
Roland
новенький
Сообщения: 25
Зарегистрирован: 23.03.2021 15:27:18
Откуда: France
Контактная информация:

Сообщение Roland »

Thank you for the code, Alexander ! Indeed, I used FPC 3.2.2.
Аватара пользователя
Roland
новенький
Сообщения: 25
Зарегистрирован: 23.03.2021 15:27:18
Откуда: France
Контактная информация:

Сообщение Roland »

Dear Alexander, I better understand your message now. It seems that MSE timer is broken in latest MSEgui by mse-org. (For this project, I used my own version.)

We are currently investigating. Sorry for the inconvenience.

Posted after 15 hours 5 minutes 48 seconds:
The bug in MSE timer has been fixed. If you want to test, please get the latest code from the repository and build MSEide by yourself (or wait the next release coming soon).

Here is a modified version of the demo. (The type casting is no longer needed.)

Thank you Alexander for the bug report. :wink:

P.-S. In fact, no need to rebuild the IDE. It is enough to use the latest version of MSEgui.
Вложения
example7_510.zip
(9.42 КБ) 608 скачиваний
Ответить